From 884e6c526c5c35471b70fae7d2b3e17d00c1430e Mon Sep 17 00:00:00 2001 From: Michael Fix Date: Fri, 27 Sep 2019 11:14:04 -0700 Subject: [PATCH] use checkbox input for toggle (#872) --- components/Toggle.js | 47 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/components/Toggle.js b/components/Toggle.js index cf1d271..81107c7 100644 --- a/components/Toggle.js +++ b/components/Toggle.js @@ -10,44 +10,45 @@ class Toggle extends React.PureComponent { toggle = () => this.props.onChange(!this.props.enabled) - handleKeydown = e => { - if (e.key === 'Enter') this.toggle() - if (e.key === ' ') { - e.preventDefault() - this.toggle() - } - } - render() { - // TODO use input[type=["checkbox"] /> instead of div return ( -
+
+ {this.props.enabled ? :
}