diff --git a/components/common/app-text-input.js b/components/common/app-text-input.js index 3ec9369680c95804f6e37e0ac2ce8d4809608c91..3a50ed25f958a70c9d4f3a0354d1e6047442e827 100644 --- a/components/common/app-text-input.js +++ b/components/common/app-text-input.js @@ -4,11 +4,14 @@ import PropTypes from 'prop-types' import { Colors, Spacing, Typography } from '../../styles' -const AppTextInput = ({ style, ...props }) => { +const AppTextInput = ({ style, isKeyboardOffset, ...props }) => { + const behavior = isKeyboardOffset ? "padding" : "height" + const keyboardVerticalOffset = isKeyboardOffset ? 300 : 0 + return ( <KeyboardAvoidingView - behavior="padding" - keyboardVerticalOffset={300} + behavior={behavior} + keyboardVerticalOffset={keyboardVerticalOffset} > <TextInput style={[styles.input, style]} {...props} /> </KeyboardAvoidingView> @@ -16,7 +19,12 @@ const AppTextInput = ({ style, ...props }) => { } AppTextInput.propTypes = { - style: PropTypes.object + style: PropTypes.object, + isKeyboardOffset: PropTypes.bool, +} + +AppTextInput.defultProps = { + isKeyboardOffset: true, } const styles = StyleSheet.create({ diff --git a/components/password-prompt.js b/components/password-prompt.js index 2924b469974a1a93e19f6971dfe8ac3ff9f5be1c..41903123936f43ce4348eb6a35d90a029e4323c6 100644 --- a/components/password-prompt.js +++ b/components/password-prompt.js @@ -89,6 +89,7 @@ export default class PasswordPrompt extends Component { <Header isSideMenuEnabled={false} /> <AppPage contentContainerStyle={styles.contentContainer}> <AppTextInput + isKeyboardOffset={false} onChangeText={this.setPassword} secureTextEntry={true} placeholder={labels.enterPassword} diff --git a/components/settings/password/enter-new-password.js b/components/settings/password/enter-new-password.js index a351099453d814eecb3f195254deddb429bde3c7..15f5d08347675990df65f79afaf9d348e767cca0 100644 --- a/components/settings/password/enter-new-password.js +++ b/components/settings/password/enter-new-password.js @@ -65,6 +65,7 @@ export default class EnterNewPassword extends Component { return ( <React.Fragment> <AppTextInput + isKeyboardOffset={false} onChangeText={this.handlePasswordInput} placeholder={labels.enterNew} textContentType="password" @@ -72,6 +73,7 @@ export default class EnterNewPassword extends Component { secureTextEntry={true} /> <AppTextInput + isKeyboardOffset={false} onChangeText={this.handleConfirmationInput} placeholder={labels.confirmPassword} textContentType="password"