From b4d50b20e7f0d2d3517652c58078e77d8dd65d34 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Fri, 7 Dec 2018 14:08:10 +0300 Subject: [PATCH] Fixed android paste issue --- .../formInput/view/formInputStyles.js | 5 +- .../formInput/view/formInputView.js | 59 +++++++++++-------- 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/src/components/formInput/view/formInputStyles.js b/src/components/formInput/view/formInputStyles.js index b1f4365a3..0783a4745 100644 --- a/src/components/formInput/view/formInputStyles.js +++ b/src/components/formInput/view/formInputStyles.js @@ -19,14 +19,15 @@ export default EStyleSheet.create({ marginLeft: 12, }, textInput: { - height: 60, flex: 0.7, + flexDirection: 'row', + justifyContent: 'center', }, icon: { flex: 0.15, fontSize: 25, top: 18, left: 8, - color:"$iconColor", + color: '$iconColor', }, }); diff --git a/src/components/formInput/view/formInputView.js b/src/components/formInput/view/formInputView.js index b819ca70b..6e9f49ed6 100644 --- a/src/components/formInput/view/formInputView.js +++ b/src/components/formInput/view/formInputView.js @@ -12,17 +12,17 @@ import styles from './formInputStyles'; class FormInputView extends Component { /* Props - * ------------------------------------------------ - * @prop { string } placeholder - Place holder text. - * @prop { string } type - Input type. - * @prop { boolean } isFirstImage - Render image from steem. - * @prop { boolean } isEditable - Can permission edit. - * @prop { boolean } isValid - This delegate input valit or not. - * @prop { boolean } secureTextEntry - For hiding password value. - * - * - * - */ + * ------------------------------------------------ + * @prop { string } placeholder - Place holder text. + * @prop { string } type - Input type. + * @prop { boolean } isFirstImage - Render image from steem. + * @prop { boolean } isEditable - Can permission edit. + * @prop { boolean } isValid - This delegate input valit or not. + * @prop { boolean } secureTextEntry - For hiding password value. + * + * + * + */ constructor(props) { super(props); @@ -30,10 +30,17 @@ class FormInputView extends Component { value: '', inputBorderColor: '#c1c5c7', isValid: true, + formInputWidth: '99%', }; } // Component Life Cycles + componentWillMount() { + setTimeout(() => { + this.setState({ formInputWidth: '100%' }); + }, 100); + } + componentWillReceiveProps(nextProps) { const { isValid } = this.props; @@ -58,7 +65,9 @@ class FormInputView extends Component { }; render() { - const { inputBorderColor, isValid, value } = this.state; + const { + inputBorderColor, isValid, value, formInputWidth, + } = this.state; const { placeholder, type, @@ -68,7 +77,6 @@ class FormInputView extends Component { rightIconName, secureTextEntry, } = this.props; - return ( )} - this._handleOnFocus()} - autoCapitalize="none" - secureTextEntry={secureTextEntry} - placeholder={placeholder} - editable={isEditable || true} - textContentType={type} - onChangeText={val => this._handleOnChange(val)} - value={value} - style={styles.textInput} - /> + + this._handleOnFocus()} + autoCapitalize="none" + secureTextEntry={secureTextEntry} + placeholder={placeholder} + editable={isEditable || true} + textContentType={type} + onChangeText={val => this._handleOnChange(val)} + value={value} + style={{ width: formInputWidth }} + /> + + {value && value.length > 0 ? ( this.setState({ value: '' })}