Adds padding between keyboard and text input

This commit is contained in:
mashazyu
2020-12-13 17:03:49 +01:00
committed by emelko
parent ead6db12a9
commit c00e3f2bef
2 changed files with 12 additions and 4 deletions
+9 -2
View File
@@ -1,11 +1,18 @@
import React from 'react'
import { StyleSheet, TextInput } from 'react-native'
import { KeyboardAvoidingView, StyleSheet, TextInput } from 'react-native'
import PropTypes from 'prop-types'
import { Colors, Spacing, Typography } from '../../styles'
const AppTextInput = ({ style, ...props }) => {
return <TextInput style={[styles.input, style]} {...props} />
return (
<KeyboardAvoidingView
behavior="padding"
keyboardVerticalOffset={250}
>
<TextInput style={[styles.input, style]} {...props} />
</KeyboardAvoidingView>
)
}
AppTextInput.propTypes = {
+3 -2
View File
@@ -215,10 +215,11 @@ class SymptomEditView extends Component {
<AppText>{symtomPage[symptom].note}</AppText>
<AppTextInput
multiline={true}
placeholder={sharedLabels.enter}
numberOfLines={3}
onChangeText={this.onEditNote}
value={noteText !== null ? noteText : ''}
placeholder={sharedLabels.enter}
testID='noteInput'
value={noteText !== null ? noteText : ''}
/>
</Segment>
}