Skip to content
Snippets Groups Projects
Commit aa0e5b68 authored by Sofiya Tepikin's avatar Sofiya Tepikin
Browse files

Merge branch 'fix/bottom-padding-after-input-field' into 'master'

Fix/bottom padding after input field

Closes #493

See merge request bloodyhealth/drip!350
parents 03905be5 659eb8da
No related branches found
No related tags found
No related merge requests found
......@@ -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({
......
......@@ -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}
......
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment