From 201bfd2e4d7482d5817dd9651303f20761281068 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Mon, 22 Aug 2016 16:32:18 -0700 Subject: [PATCH] [change] remove 'label' element from Switch --- src/components/Switch/index.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/Switch/index.js b/src/components/Switch/index.js index 9b55a3d9..4553e863 100644 --- a/src/components/Switch/index.js +++ b/src/components/Switch/index.js @@ -94,19 +94,15 @@ class Switch extends Component { disabled && styles.disabledThumb ] - const nativeControl = createDOMElement('label', { - children: createDOMElement('input', { - checked: value, - disabled: disabled, - onBlur: this._handleFocusState, - onChange: this._handleChange, - onFocus: this._handleFocusState, - ref: this._setCheckboxRef, - style: styles.cursorInherit, - type: 'checkbox' - }), - pointerEvents: 'none', - style: [ styles.nativeControl, styles.cursorInherit ] + const nativeControl = createDOMElement('input', { + checked: value, + disabled: disabled, + onBlur: this._handleFocusState, + onChange: this._handleChange, + onFocus: this._handleFocusState, + ref: this._setCheckboxRef, + style: [ styles.nativeControl, styles.cursorInherit ], + type: 'checkbox' }) return ( @@ -169,7 +165,11 @@ const styles = StyleSheet.create({ }, nativeControl: { ...StyleSheet.absoluteFillObject, - opacity: 0 + height: '100%', + margin: 0, + opacity: 0, + padding: 0, + width: '100%' } })