Adds padding between keyboard and text input

This commit is contained in:
mashazyu authored and emelko committed 2020-12-13 18:02:39 +01:00
1 parent ead6db12a9
commit c00e3f2bef
2 files changed
+12 -4

No files matched your search

+9 -2
View File
@@ -1,11 +1,18 @@
import React from 'react' import React from 'react'
import { StyleSheet, TextInput } from 'react-native' import { KeyboardAvoidingView, StyleSheet, TextInput } from 'react-native'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { Colors, Spacing, Typography } from '../../styles' import { Colors, Spacing, Typography } from '../../styles'
const AppTextInput = ({ style, ...props }) => { 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 = { AppTextInput.propTypes = {
+3 -2
View File
@@ -215,10 +215,11 @@ class SymptomEditView extends Component {
<AppText>{symtomPage[symptom].note}</AppText> <AppText>{symtomPage[symptom].note}</AppText>
<AppTextInput <AppTextInput
multiline={true} multiline={true}
placeholder={sharedLabels.enter} numberOfLines={3}
onChangeText={this.onEditNote} onChangeText={this.onEditNote}
value={noteText !== null ? noteText : ''} placeholder={sharedLabels.enter}
testID='noteInput' testID='noteInput'
value={noteText !== null ? noteText : ''}
/> />
</Segment> </Segment>
} }