diff --git a/packages/core/client/src/schema-component/antd/page/FixedBlock.tsx b/packages/core/client/src/schema-component/antd/page/FixedBlock.tsx index 1c3cb3568..8138cddaa 100644 --- a/packages/core/client/src/schema-component/antd/page/FixedBlock.tsx +++ b/packages/core/client/src/schema-component/antd/page/FixedBlock.tsx @@ -42,17 +42,20 @@ export const FixedBlockWrapper: React.FC = (props) => { const fixedBlock = useFixedSchema(); const { height, fixedBlockUID } = useFixedBlock(); const record = useRecord(); - const isPopup = Object.keys(record); + const isPopup = Object.keys(record).length; + if (isPopup) { + return <>{props.children}; + } /** * The fixedBlockUID of false means that the page has no fixed blocks * isPopup means that the FixedBlock is in the popup mode */ - if (!fixedBlock && fixedBlockUID && !isPopup) return null; + if (!fixedBlock && fixedBlockUID) return null; return (
{props.children} @@ -67,30 +70,28 @@ export const FixedBlockDesignerItem = () => { const { dn } = useDesignable(); const record = useRecord(); - return useMemo(() => { - if (Object.keys(record).length) { - return; - } - return ( - { - const decoratorProps = { - ...fieldSchema['x-decorator-props'], - fixedBlock, - }; - await dn.emit('patch', { - schema: { - ['x-uid']: fieldSchema['x-uid'], - 'x-decorator-props': decoratorProps, - }, - }); - field.decoratorProps = fieldSchema['x-decorator-props'] = decoratorProps; - }} - /> - ); - }, [fieldSchema['x-decorator-props'], field.decoratorProps?.fixedBlock, dn, record]); + if (Object.keys(record).length) { + return null; + } + return ( + { + const decoratorProps = { + ...fieldSchema['x-decorator-props'], + fixedBlock, + }; + await dn.emit('patch', { + schema: { + ['x-uid']: fieldSchema['x-uid'], + 'x-decorator-props': decoratorProps, + }, + }); + field.decoratorProps = fieldSchema['x-decorator-props'] = decoratorProps; + }} + /> + ); }; interface FixedBlockProps {