From b3ace768a856fc5e26ea52ae74c972242826dc0b Mon Sep 17 00:00:00 2001 From: Bl00dyMarie <bl00dymarie@mailbox.org> Date: Wed, 15 Aug 2018 09:41:05 +0200 Subject: [PATCH] Text input is autofocussed only when someone just checked the "Other" checkbox :) --- components/cycle-day/symptoms/sex.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/cycle-day/symptoms/sex.js b/components/cycle-day/symptoms/sex.js index 5a90249f..d9ec3366 100644 --- a/components/cycle-day/symptoms/sex.js +++ b/components/cycle-day/symptoms/sex.js @@ -116,13 +116,16 @@ export default class Sex extends Component { <CheckBox value={this.state.other} onValueChange={(val) => { - this.setState({other: val}) + this.setState({ + other: val, + focusTextArea: true + }) }} /> </View> { this.state.other && <TextInput - autoFocus={true} + autoFocus={this.state.focusTextArea} multiline={true} placeholder="Enter" value={this.state.note} -- GitLab