[change] remove 'label' element from Switch

This commit is contained in:
Nicolas Gallagher
2016-08-22 16:32:18 -07:00
parent 496839d19a
commit 201bfd2e4d
+14 -14
View File
@@ -94,19 +94,15 @@ class Switch extends Component {
disabled && styles.disabledThumb disabled && styles.disabledThumb
] ]
const nativeControl = createDOMElement('label', { const nativeControl = createDOMElement('input', {
children: createDOMElement('input', { checked: value,
checked: value, disabled: disabled,
disabled: disabled, onBlur: this._handleFocusState,
onBlur: this._handleFocusState, onChange: this._handleChange,
onChange: this._handleChange, onFocus: this._handleFocusState,
onFocus: this._handleFocusState, ref: this._setCheckboxRef,
ref: this._setCheckboxRef, style: [ styles.nativeControl, styles.cursorInherit ],
style: styles.cursorInherit, type: 'checkbox'
type: 'checkbox'
}),
pointerEvents: 'none',
style: [ styles.nativeControl, styles.cursorInherit ]
}) })
return ( return (
@@ -169,7 +165,11 @@ const styles = StyleSheet.create({
}, },
nativeControl: { nativeControl: {
...StyleSheet.absoluteFillObject, ...StyleSheet.absoluteFillObject,
opacity: 0 height: '100%',
margin: 0,
opacity: 0,
padding: 0,
width: '100%'
} }
}) })