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
+5 -1
View File
@@ -54,10 +54,14 @@ class Sex extends Component {
toggleState = (key) => {
const curr = this.state[key]
this.setState({[key]: !curr})
if (key === 'other' && !curr) {
if (key === 'other'){
if (curr){
this.setState({note: ""})
} else {
this.setState({focusTextArea: true})
}
}
}
render() {
return (