From e6719763f641f55b7ad113306fc191608f6ad682 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Sun, 25 Feb 2024 17:36:16 +0800 Subject: [PATCH] refactor: the default openSize of dialog should be middle (#3569) --- .../client/src/schema-component/antd/action/Action.Modal.tsx | 2 +- .../src/schema-component/antd/form-item/FormItem.Settings.tsx | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/action/Action.Modal.tsx b/packages/core/client/src/schema-component/antd/action/Action.Modal.tsx index a04dc02fd8..d67444c857 100644 --- a/packages/core/client/src/schema-component/antd/action/Action.Modal.tsx +++ b/packages/core/client/src/schema-component/antd/action/Action.Modal.tsx @@ -15,7 +15,7 @@ const openSizeWidthMap = new Map([ export const ActionModal: ComposedActionDrawer = observer( (props) => { const { footerNodeName = 'Action.Modal.Footer', width, ...others } = props; - const { visible, setVisible, openSize = 'large', modalProps } = useActionContext(); + const { visible, setVisible, openSize = 'middle', modalProps } = useActionContext(); const actualWidth = width ?? openSizeWidthMap.get(openSize); const schema = useFieldSchema(); const field = useField(); diff --git a/packages/core/client/src/schema-component/antd/form-item/FormItem.Settings.tsx b/packages/core/client/src/schema-component/antd/form-item/FormItem.Settings.tsx index f3f9acae7a..a26cc7e22e 100644 --- a/packages/core/client/src/schema-component/antd/form-item/FormItem.Settings.tsx +++ b/packages/core/client/src/schema-component/antd/form-item/FormItem.Settings.tsx @@ -427,9 +427,7 @@ export const formItemSettings = new SchemaSettings({ { label: t('Middle'), value: 'middle' }, { label: t('Large'), value: 'large' }, ], - value: - fieldSchema?.['x-component-props']?.['openSize'] ?? - (fieldSchema?.['x-component-props']?.['openMode'] == 'modal' ? 'large' : 'middle'), + value: fieldSchema?.['x-component-props']?.['openSize'] ?? 'middle', onChange: (value) => { field.componentProps.openSize = value; fieldSchema['x-component-props'] = field.componentProps;