forked from p15670423/monkey
parent
43c5834d51
commit
793bb99309
|
@ -94,9 +94,11 @@ class AdvancedMultiSelect extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
setMasterCheckboxState(selectValues) {
|
setMasterCheckboxState(selectValues) {
|
||||||
this.setState(() => ({
|
let newState = this.getMasterCheckboxState(selectValues);
|
||||||
masterCheckboxState: this.getMasterCheckboxState(selectValues)
|
|
||||||
}));
|
if (newState != this.state.masterCheckboxState) {
|
||||||
|
this.setState({masterCheckboxState: newState});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getMasterCheckboxState(selectValues) {
|
getMasterCheckboxState(selectValues) {
|
||||||
|
@ -188,6 +190,10 @@ class AdvancedMultiSelect extends React.Component {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidUpdate(_prevProps) {
|
||||||
|
this.setMasterCheckboxState(this.props.value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default AdvancedMultiSelect;
|
export default AdvancedMultiSelect;
|
||||||
|
|
Loading…
Reference in New Issue