ui: properly render master checkbox on import or reset

Fixes #1018
This commit is contained in:
Mike Salvatore 2021-03-05 12:32:34 -05:00
parent 43c5834d51
commit 793bb99309
1 changed files with 9 additions and 3 deletions

View File

@ -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;