From 82feb36c5b5bde86e96b5b117ebcfe3a145e61e5 Mon Sep 17 00:00:00 2001 From: RickCole Date: Thu, 21 Oct 2021 21:45:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20CRUD=20=E8=BD=AE?= =?UTF-8?q?=E8=AE=AD=20stopAutoRefreshWhen=20=E5=90=8E=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=86=8D=E6=AC=A1=E8=A7=A6=E5=8F=91=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#2744)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/CRUD.tsx | 2 +- src/renderers/Form/ButtonGroupSelect.tsx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderers/CRUD.tsx b/src/renderers/CRUD.tsx index 6d6416799..e02051b64 100644 --- a/src/renderers/CRUD.tsx +++ b/src/renderers/CRUD.tsx @@ -1057,7 +1057,7 @@ export default class CRUD extends React.Component { (!stopAutoRefreshWhen || !( (stopAutoRefreshWhenModalIsOpen && store.hasModalOpened) || - evalExpression(stopAutoRefreshWhen, data) + evalExpression(stopAutoRefreshWhen, createObject(store.data, store.query)) )) && (this.timer = setTimeout( silentPolling diff --git a/src/renderers/Form/ButtonGroupSelect.tsx b/src/renderers/Form/ButtonGroupSelect.tsx index c48d6cc20..f3fd92ebd 100644 --- a/src/renderers/Form/ButtonGroupSelect.tsx +++ b/src/renderers/Form/ButtonGroupSelect.tsx @@ -108,6 +108,9 @@ export default class ButtonGroupControl extends React.Component< className: cx(option.className, btnClassName), disabled: option.disabled || disabled, onClick: (e: React.UIEvent) => { + if (disabled) { + return; + } this.handleToggle(option); e.preventDefault(); // 禁止 onAction 触发 }