fix(xo-web/form/Toggle): dont emit onChange if disabled (#3643)
fix(xo-web/form/Toggle): dont emit onChange if disabled
This commit is contained in:
committed by
Julien Fontanet
parent
ec5bc1db95
commit
6629c12166
@@ -26,7 +26,10 @@ export default class Toggle extends Component {
|
||||
|
||||
_toggle = () => {
|
||||
const { props } = this
|
||||
props.onChange(!props.value)
|
||||
|
||||
if (!props.disabled) {
|
||||
props.onChange(!props.value)
|
||||
}
|
||||
}
|
||||
|
||||
render () {
|
||||
|
||||
Reference in New Issue
Block a user