diff --git a/src/components/formInput/view/formInputView.tsx b/src/components/formInput/view/formInputView.tsx index 5a042190b..69e87a4e3 100644 --- a/src/components/formInput/view/formInputView.tsx +++ b/src/components/formInput/view/formInputView.tsx @@ -26,6 +26,7 @@ interface Props extends TextInputProps { inputStyle:TextStyle; isValid:boolean; onChange?:(value:string)=>void; + handleFocus?:(value:boolean)=>void; } const FormInputView = ({ @@ -44,6 +45,7 @@ const FormInputView = ({ isValid, value, onBlur, + handleFocus, ...props }:Props) => { const [_value, setValue] = useState(value || ''); @@ -62,11 +64,16 @@ const FormInputView = ({ const _handleOnFocus = () => { setInputBorderColor('#357ce6'); + if(handleFocus){ + handleFocus(true); + } }; const _handleOnBlur = () => { setInputBorderColor('#e7e7e7'); - + if(handleFocus){ + handleFocus(false); + } if (onBlur) { onBlur(); } diff --git a/src/components/loginHeader/view/loginHeaderStyles.js b/src/components/loginHeader/view/loginHeaderStyles.js index 7e4cb5b48..1692ed49e 100644 --- a/src/components/loginHeader/view/loginHeaderStyles.js +++ b/src/components/loginHeader/view/loginHeaderStyles.js @@ -48,6 +48,7 @@ export default EStyleSheet.create({ flexDirection: 'row', justifyContent: 'space-between', backgroundColor: '$primaryBackgroundColor', + paddingVertical: 8, }, logo: { width: 32, diff --git a/src/screens/login/screen/loginScreen.js b/src/screens/login/screen/loginScreen.js index fab4649ee..8f6861ce8 100644 --- a/src/screens/login/screen/loginScreen.js +++ b/src/screens/login/screen/loginScreen.js @@ -62,6 +62,9 @@ class LoginScreen extends PureComponent { this.setState({ isModalOpen: !isModalOpen }); }; + _handleFormInputFocus = (isFocused) => { + this.setState({ keyboardIsOpen: isFocused }); + }; render() { const { navigation, intl, handleOnPressLogin, handleSignUp, isLoading } = this.props; const { username, isUsernameValid, keyboardIsOpen, password, isModalOpen } = this.state; @@ -102,8 +105,6 @@ class LoginScreen extends PureComponent { style={styles.tabbarItem} > this.setState({ keyboardIsOpen: true })} - onKeyboardWillHide={() => this.setState({ keyboardIsOpen: false })} enableAutoAutomaticScroll={Platform.OS === 'ios'} contentContainerStyle={styles.formWrapper} enableOnAndroid={true} @@ -122,6 +123,7 @@ class LoginScreen extends PureComponent { isFirstImage value={username} inputStyle={styles.input} + handleFocus={this._handleFormInputFocus} />