fix: 修复 CRUD 轮训 stopAutoRefreshWhen 后无法再次触发的问题 (#2744)

This commit is contained in:
RickCole 2021-10-21 21:45:59 +08:00 committed by GitHub
parent b7766a82fa
commit 82feb36c5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -1057,7 +1057,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
(!stopAutoRefreshWhen ||
!(
(stopAutoRefreshWhenModalIsOpen && store.hasModalOpened) ||
evalExpression(stopAutoRefreshWhen, data)
evalExpression(stopAutoRefreshWhen, createObject(store.data, store.query))
)) &&
(this.timer = setTimeout(
silentPolling

View File

@ -108,6 +108,9 @@ export default class ButtonGroupControl extends React.Component<
className: cx(option.className, btnClassName),
disabled: option.disabled || disabled,
onClick: (e: React.UIEvent<any>) => {
if (disabled) {
return;
}
this.handleToggle(option);
e.preventDefault(); // 禁止 onAction 触发
}