mirror of
https://github.com/ascribe/onion.git
synced 2024-12-31 09:07:48 +01:00
Check for the checkbox being unchecked before reseting value
This commit is contained in:
parent
fb917f1a09
commit
9f553f973c
@ -240,10 +240,17 @@ const Property = React.createClass({
|
||||
},
|
||||
|
||||
handleCheckboxToggle() {
|
||||
this.setExpanded(!this.state.expanded);
|
||||
this.setState({
|
||||
value: this.state.initialValue
|
||||
});
|
||||
const expanded = !this.state.expanded;
|
||||
|
||||
this.setExpanded(expanded);
|
||||
|
||||
// Reset the value to be the initial value when the checkbox is unticked since the
|
||||
// user doesn't want to specify their own value.
|
||||
if (!expanded) {
|
||||
this.setState({
|
||||
value: this.state.initialValue
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
renderChildren(style) {
|
||||
|
Loading…
Reference in New Issue
Block a user