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