Merge pull request #310 from catchonme/master

修复checkboxes拉取数据无法设置全选问题
This commit is contained in:
liaoxuezhi 2019-10-25 17:30:45 +08:00 committed by GitHub
commit 5b93d128b8

View File

@ -25,6 +25,15 @@ export default class CheckboxesControl extends React.Component<CheckboxesProps,
defaultCheckAll && onToggleAll();
}
componentDidUpdate(prevProps:OptionsControlProps) {
let {options: currOptions, onToggleAll, defaultCheckAll} = this.props;
let {options: prevOptions} = prevProps;
if (defaultCheckAll && prevOptions != currOptions) {
onToggleAll();
}
}
reload() {
const reload = this.props.reloadOptions;
reload && reload();