mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-02 02:25:22 +00:00
[change] remove 'label' element from Switch
This commit is contained in:
@@ -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%'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user