Text input is autofocussed only when someone just checked the "Other" checkbox :)

This commit is contained in:
Bl00dyMarie
2018-08-15 09:41:05 +02:00
parent a64bfbcd50
commit b3ace768a8
+5 -2
View File
@@ -116,13 +116,16 @@ export default class Sex extends Component {
<CheckBox <CheckBox
value={this.state.other} value={this.state.other}
onValueChange={(val) => { onValueChange={(val) => {
this.setState({other: val}) this.setState({
other: val,
focusTextArea: true
})
}} }}
/> />
</View> </View>
{ this.state.other && { this.state.other &&
<TextInput <TextInput
autoFocus={true} autoFocus={this.state.focusTextArea}
multiline={true} multiline={true}
placeholder="Enter" placeholder="Enter"
value={this.state.note} value={this.state.note}