From 02db9c172234f21a7ada19e3adee54fa72f04cce Mon Sep 17 00:00:00 2001 From: Cathrin Senst <cathrin.senst@gmail.com> Date: Sat, 28 Mar 2020 14:21:34 +0100 Subject: [PATCH] fix 306 by setting other-note empty as contraception method 'other' is deactivated --- components/cycle-day/symptoms/sex.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/cycle-day/symptoms/sex.js b/components/cycle-day/symptoms/sex.js index 5cb636ea..6b4bd96f 100644 --- a/components/cycle-day/symptoms/sex.js +++ b/components/cycle-day/symptoms/sex.js @@ -54,8 +54,12 @@ class Sex extends Component { toggleState = (key) => { const curr = this.state[key] this.setState({[key]: !curr}) - if (key === 'other' && !curr) { - this.setState({focusTextArea: true}) + if (key === 'other'){ + if (curr){ + this.setState({note: ""}) + } else { + this.setState({focusTextArea: true}) + } } } -- GitLab