From e80ef27f797821a00fcfdf800ef3b290cdff51dd Mon Sep 17 00:00:00 2001 From: Zeke Zhang <958414905@qq.com> Date: Thu, 6 Mar 2025 16:54:16 +0800 Subject: [PATCH] fix: move visibility check for action button to the correct location --- .../client/src/schema-component/antd/action/Action.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/action/Action.tsx b/packages/core/client/src/schema-component/antd/action/Action.tsx index 2b5df6b5dd..a0d1d9fcc9 100644 --- a/packages/core/client/src/schema-component/antd/action/Action.tsx +++ b/packages/core/client/src/schema-component/antd/action/Action.tsx @@ -19,6 +19,7 @@ import { useTranslation } from 'react-i18next'; import { ErrorFallback, StablePopover, TabsContextProvider, useActionContext } from '../..'; import { useDesignable } from '../../'; import { useACLActionParamsContext } from '../../../acl'; +import { useApp } from '../../../application'; import { useCollectionParentRecordData, useCollectionRecordData, @@ -554,11 +555,6 @@ const RenderButtonInner = observer( title, ...others } = props; - - if (!designable && (field?.data?.hidden || !aclCtx)) { - return null; - } - const debouncedClick = useCallback( debounce( (e: React.MouseEvent, checkPortal = true) => { @@ -576,6 +572,10 @@ const RenderButtonInner = observer( }; }, []); + if (!designable && (field?.data?.hidden || !aclCtx)) { + return null; + } + const actionTitle = title || field?.title; return (