mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 03:11:38 +03:00
fixed header not hiding on android on login screen when keyboard is active
This commit is contained in:
parent
9443000049
commit
0a064fc56b
@ -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();
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ export default EStyleSheet.create({
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
backgroundColor: '$primaryBackgroundColor',
|
||||
paddingVertical: 8,
|
||||
},
|
||||
logo: {
|
||||
width: 32,
|
||||
|
@ -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}
|
||||
>
|
||||
<KeyboardAwareScrollView
|
||||
onKeyboardWillShow={() => 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}
|
||||
/>
|
||||
<FormInput
|
||||
rightIconName="lock"
|
||||
@ -136,6 +138,7 @@ class LoginScreen extends PureComponent {
|
||||
type="password"
|
||||
numberOfLines={1}
|
||||
inputStyle={styles.input}
|
||||
handleFocus={this._handleFormInputFocus}
|
||||
/>
|
||||
<InformationArea
|
||||
description={intl.formatMessage({
|
||||
|
Loading…
Reference in New Issue
Block a user