fix 306 by setting other-note empty as contraception method 'other' is deactivated

This commit is contained in:
Cathrin Senst
2020-03-28 14:21:34 +01:00
parent 9235a57fd7
commit 02db9c1722
+6 -2
View File
@@ -54,8 +54,12 @@ class Sex extends Component {
toggleState = (key) => { toggleState = (key) => {
const curr = this.state[key] const curr = this.state[key]
this.setState({[key]: !curr}) this.setState({[key]: !curr})
if (key === 'other' && !curr) { if (key === 'other'){
this.setState({focusTextArea: true}) if (curr){
this.setState({note: ""})
} else {
this.setState({focusTextArea: true})
}
} }
} }