Adds padding between keyboard and text input
This commit is contained in:
@@ -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 = {
|
||||||
|
|||||||
@@ -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>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user