Skip to content

Refactor ModalForm components to use modalProps for title and width configuration#9504

Open
zzjiaxiang wants to merge 3 commits intoant-design:masterfrom
zzjiaxiang:ModalForm
Open

Refactor ModalForm components to use modalProps for title and width configuration#9504
zzjiaxiang wants to merge 3 commits intoant-design:masterfrom
zzjiaxiang:ModalForm

Conversation

@zzjiaxiang
Copy link
Contributor

@zzjiaxiang zzjiaxiang commented Feb 24, 2026

将外层的 titlewidth 统一收敛到 modalProps 里面. 这两个都属于 antd modal 的属性

Summary by CodeRabbit

  • 重构

    • ModalForm 公开 API 调整:移除 title 与 width 直接属性,改由 modalProps 传入(如 modalProps={{ title: '标题' }})。
    • DrawerForm 同步采用 drawerProps 传入标题方式。
    • 组件内部改为从 modalProps/ drawerProps 读取标题与相关配置。
  • 文档 / 示例

    • 更新文档与示例:移除独立 title/width 条目,示例中将所有 title 改为通过 modalProps/drawerProps 提供。

- Updated ModalForm instances to pass title through modalProps instead of directly.
- Ensured consistency across various ModalForm demos and documentation.
- Adjusted related documentation to reflect the changes in prop usage.
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 24, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @zzjiaxiang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the ModalForm component's interface by integrating the title and width properties into the modalProps object. This change enhances consistency with the underlying Ant Design Modal component, simplifying its usage and maintenance. The update includes necessary modifications across demo examples and documentation to reflect this unified approach.

Highlights

  • API Refactoring: The title and width properties of the ModalForm component have been consolidated into the modalProps object, aligning its API with Ant Design's Modal component.
  • Demo Updates: All relevant demo files have been updated to reflect the new way of configuring title and width via modalProps.
  • Documentation Alignment: Both English and Chinese documentation for ModalForm have been updated to remove the standalone title and width props and clarify their inclusion within modalProps.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • demos/form/ModalForm/modal-form-request-destroy-debug.tsx
    • Moved the title prop into the modalProps object.
  • demos/form/ModalForm/modal-form-reset.tsx
    • Refactored ModalForm instances to pass the title prop via modalProps.
  • demos/form/ModalForm/modal-form-submitter.tsx
    • Modified ModalForm components to configure the title prop through modalProps.
  • demos/form/ModalForm/modal-form.tsx
    • Relocated the title prop from ModalForm directly into modalProps.
  • demos/form/ModalForm/open-on-open-change.tsx
    • Adjusted ModalForm and DrawerForm to accept the title prop within their respective props objects (modalProps and drawerProps).
  • site/components/modal-form.en-US.md
    • Removed title and width properties from the ModalForm API documentation table.
  • site/components/modal-form.md
    • Removed title and width properties from the ModalForm API documentation table.
  • src/form/layouts/ModalForm/index.tsx
    • Refactored ModalForm to remove direct title and width props from its interface and component, consolidating their usage into modalProps.
Activity
  • No activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 013e1c8 and e218b58.

📒 Files selected for processing (1)
  • site/components/modal-form.en-US.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • site/components/modal-form.en-US.md

📝 Walkthrough

Walkthrough

本次变更将 ModalForm 的顶层 titlewidth props 移除,改为通过 modalProps 传入(示例与 DrawerForm 的 title 对应改为 drawerProps),并同步更新示例代码与文档以反映新用法。(不改变其他行为)

Changes

Cohort / File(s) Summary
演示文件更新
demos/form/ModalForm/modal-form-request-destroy-debug.tsx, demos/form/ModalForm/modal-form-reset.tsx, demos/form/ModalForm/modal-form-submitter.tsx, demos/form/ModalForm/modal-form.tsx, demos/form/ModalForm/open-on-open-change.tsx
将示例中对 ModalForm 的直接 title prop 替换为 modalProps={{ title: '...' }}open-on-open-change.tsx 中同时将 DrawerFormtitle 改为 drawerProps={{ title: '...' }}。示例行为保持不变。
文档更新
site/components/modal-form.en-US.md, site/components/modal-form.md
在 ModalForm API 表中移除独立的 titlewidth 行,更新 modalProps 的说明与链接指向 Ant Design Modal 文档。
主组件实现与类型
src/form/layouts/ModalForm/index.tsx
ModalFormProps 中移除 titlewidth,组件实现停止接收/转发这两个顶层属性,改为将 modalProps 展开传递给内部 Modal

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 夜里搬标题,轻轻换个家,
从顶层到 modalProps,旅途不喧哗。
示例跟着走,文档也去看,
小兔一跳,代码更整洁欢🎶

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确总结了主要变更:将 ModalForm 组件的 title 和 width 属性重构为 modalProps 的配置。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

此拉取请求将 ModalForm 组件的 titlewidth 属性统一收敛到 modalProps 中,使 API 更加一致。代码实现和文档更新都反映了这一变化。然而,在 DrawerForm 的使用示例中存在一个不一致之处,并且 ModalForm 的默认宽度行为也发生了变化。

<DrawerForm
onOpenChange={setDrawerVisit}
title="Create New Form"
drawerProps={{ title: 'Create New Form' }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

此处的 DrawerForm 示例将 title 属性放在了 drawerProps 中。然而,根据 src/form/layouts/DrawerForm/index.tsx 中的定义,DrawerForm 仍然期望 title 作为其直接属性,而不是 drawerProps 的一部分。这导致了示例与组件实际 API 之间的不一致。请将 title 属性移出 drawerProps,或者更新 DrawerForm 的定义以匹配此用法。

Suggested change
drawerProps={{ title: 'Create New Form' }}
title="Create New Form"
drawerProps={{}}

<Modal
title={title}
width={width || 800}
{...modalProps}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

在之前的实现中,如果 width 属性未提供,ModalForm 会默认使用 800px 的宽度 (width || 800)。现在,width 属性被移除,并且 modalProps 被直接展开。这意味着 Modal 组件将使用其自身的默认宽度(通常为 520px),而不是之前的 800px。这可能导致默认布局发生变化,建议在 modalProps 中显式设置一个默认宽度,以保持与之前行为的一致性,或者在文档中明确说明此默认宽度变更。

Suggested change
{...modalProps}
{...modalProps}
width={modalProps?.width || 800}

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/form/layouts/ModalForm/index.tsx (1)

21-64: ⚠️ Potential issue | 🟠 Major

破坏性变更:移除 titlewidth 直接 prop,未提供迁移降级路径

titlewidth 被移出 ModalFormProps 后,现有用户使用 <ModalForm title="..." /><ModalForm width={500} /> 的代码将直接产生 TypeScript 编译错误,且没有任何运行时警告提示迁移方向。组件内已有 noteOnce 的先例可供参考。

建议在完全移除前,保留带有 @deprecated 标记的 prop 并发出 noteOnce 警告,实现平滑迁移:

💡 建议的兼容降级方案(提供过渡期)
 export type ModalFormProps<
   T = Record<string, any>,
   U = Record<string, any>,
 > = Omit<FormProps<T>, 'onFinish' | 'title'> &
   CommonFormProps<T, U> & {
     onFinish?: (formData: T) => Promise<any>;
     submitTimeout?: number;
     trigger?: React.JSX.Element;
     open?: ModalProps['open'];
     onOpenChange?: (open: boolean) => void;
+    /** `@deprecated` 请使用 modalProps.title */
+    title?: ModalProps['title'];
+    /** `@deprecated` 请使用 modalProps.width */
+    width?: ModalProps['width'];
     /** `@description` antd Modal [props](https://ant.design/components/modal#api) */
     modalProps?: Omit<ModalProps, 'open'>;
   };

 function ModalForm<T = Record<string, any>, U = Record<string, any>>({
   children,
   trigger,
   onOpenChange,
   modalProps,
   onFinish,
   submitTimeout,
   open: propsOpen,
+  title,
+  width,
   ...rest
 }: ModalFormProps<T, U>) {
+  noteOnce(
+    !title,
+    'ModalForm 的 title prop 已废弃,请改用 modalProps.title',
+  );
+  noteOnce(
+    !width,
+    'ModalForm 的 width prop 已废弃,请改用 modalProps.width',
+  );
   ...
   <Modal
+    title={title}
+    width={width}
     {...modalProps}
     open={open}

Based on learnings: "Applies to **/*.{ts,tsx}: Maintain backward compatibility and avoid breaking changes."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/form/layouts/ModalForm/index.tsx` around lines 21 - 64, Reintroduce title
and width as deprecated props on ModalFormProps and accept them in the ModalForm
parameter list so existing consumers don't get a TS error: add title?:
ModalProps['title'] and width?: ModalProps['width'] with `@deprecated` JSDoc, then
in ModalForm, if title or width are provided, merge them into modalProps
(without overriding explicit modalProps values) and call noteOnce with a clear
migration message (referencing ModalForm and ModalFormProps) so users see the
deprecation warning at runtime; keep the new modalProps behavior as primary and
ensure TypeScript still prefers modalProps when both are supplied.
demos/form/ModalForm/modal-form-request-destroy-debug.tsx (1)

33-37: ⚠️ Potential issue | 🟡 Minor

同文件内 DrawerFormtitle 用法与 ModalForm 不一致

本文件中 ModalForm 已将 title 移入 modalProps,而同一文件的 DrawerForm 仍使用顶层 title prop,两者风格不统一,阅读时容易产生混淆。

若本 PR 仅针对 ModalForm,此处保持不变是合理的;若有意在 demo 层面保持一致,可将其对齐:

  <DrawerForm
-   title="Debug: destroyOnHidden + request (Drawer)"
    trigger={<Button type="primary">Open Drawer (Debug)</Button>}
-   drawerProps={{ destroyOnHidden: true }}
+   drawerProps={{ destroyOnHidden: true, title: 'Debug: destroyOnHidden + request (Drawer)' }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@demos/form/ModalForm/modal-form-request-destroy-debug.tsx` around lines 33 -
37, The DrawerForm is using the top-level title prop while ModalForm in this
file moved title into modalProps, causing inconsistent demo style; update the
DrawerForm usage by removing the top-level title prop and placing the same title
string into drawerProps (i.e., set drawerProps.title = "Debug: destroyOnHidden +
request (Drawer)"), keeping any existing drawerProps like destroyOnHidden intact
so the component API usage matches ModalForm's pattern.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@demos/form/ModalForm/open-on-open-change.tsx`:
- Around line 115-118: 将 DrawerForm 的 title 从 drawerProps 中提取出来,改为直接使用 title
prop:在使用的组件 DrawerForm 上移除 drawerProps 中的 title(即不要传 drawerProps={{ title: ...
}}),并添加 title="Create New Form" 同时保留 onOpenChange={setDrawerVisit} 和
open={drawerVisit},确保只使用 DrawerForm 的一级 API(组件名 DrawerForm,属性
title、drawerProps)。

In `@site/components/modal-form.en-US.md`:
- Line 52: The English docs entry for modalProps uses a hyperlink instead of the
TypeScript type; update the Type column for modalProps to match the Chinese doc
by replacing the link text with the actual type declaration Omit<ModalProps,
'open'> (and keep the note about 'open' not being supported), ensuring the
modalProps row shows the TypeScript type rather than the [props] link; locate
the modalProps table entry in modal-form.en-US.md and make this substitution.

---

Outside diff comments:
In `@demos/form/ModalForm/modal-form-request-destroy-debug.tsx`:
- Around line 33-37: The DrawerForm is using the top-level title prop while
ModalForm in this file moved title into modalProps, causing inconsistent demo
style; update the DrawerForm usage by removing the top-level title prop and
placing the same title string into drawerProps (i.e., set drawerProps.title =
"Debug: destroyOnHidden + request (Drawer)"), keeping any existing drawerProps
like destroyOnHidden intact so the component API usage matches ModalForm's
pattern.

In `@src/form/layouts/ModalForm/index.tsx`:
- Around line 21-64: Reintroduce title and width as deprecated props on
ModalFormProps and accept them in the ModalForm parameter list so existing
consumers don't get a TS error: add title?: ModalProps['title'] and width?:
ModalProps['width'] with `@deprecated` JSDoc, then in ModalForm, if title or width
are provided, merge them into modalProps (without overriding explicit modalProps
values) and call noteOnce with a clear migration message (referencing ModalForm
and ModalFormProps) so users see the deprecation warning at runtime; keep the
new modalProps behavior as primary and ensure TypeScript still prefers
modalProps when both are supplied.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a07592d and 19fc74a.

📒 Files selected for processing (8)
  • demos/form/ModalForm/modal-form-request-destroy-debug.tsx
  • demos/form/ModalForm/modal-form-reset.tsx
  • demos/form/ModalForm/modal-form-submitter.tsx
  • demos/form/ModalForm/modal-form.tsx
  • demos/form/ModalForm/open-on-open-change.tsx
  • site/components/modal-form.en-US.md
  • site/components/modal-form.md
  • src/form/layouts/ModalForm/index.tsx

Comment on lines 115 to 118
<DrawerForm
onOpenChange={setDrawerVisit}
title="Create New Form"
drawerProps={{ title: 'Create New Form' }}
open={drawerVisit}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Find DrawerForm source code
fd "DrawerForm" --type f \( -name "*.tsx" -o -name "*.ts" \) | grep -E "src|components" | head -20

Repository: ant-design/pro-components

Length of output: 299


🏁 Script executed:

# Search for drawerProps in the codebase
rg "drawerProps" --type tsx --type ts -C 2 | head -50

Repository: ant-design/pro-components

Length of output: 96


🏁 Script executed:

# Check DrawerForm documentation
fd "modal-form" --type f \( -name "*.md" -o -name "*.en-US.md" \) | head -10

Repository: ant-design/pro-components

Length of output: 299


🏁 Script executed:

# Find DrawerForm source code
fd "DrawerForm" -e tsx -e ts src components | head -20

Repository: ant-design/pro-components

Length of output: 125


🏁 Script executed:

# Search for drawerProps in the codebase
rg "drawerProps" -t ts -A 2 -B 2 | head -80

Repository: ant-design/pro-components

Length of output: 3962


🏁 Script executed:

# Check the demo file to see ModalForm usage
cat demos/form/ModalForm/open-on-open-change.tsx | head -50

Repository: ant-design/pro-components

Length of output: 1231


🏁 Script executed:

# Find DrawerForm component definition
rg "export.*DrawerForm|const DrawerForm|function DrawerForm" -t ts | head -10

Repository: ant-design/pro-components

Length of output: 548


🏁 Script executed:

# Read DrawerForm source implementation
cat src/form/layouts/DrawerForm/index.tsx | head -150

Repository: ant-design/pro-components

Length of output: 4138


🏁 Script executed:

# Look for ModalForm source to compare
cat src/form/layouts/ModalForm/index.tsx | head -150

Repository: ant-design/pro-components

Length of output: 3866


🏁 Script executed:

# Check if there's a direct title prop in DrawerForm
rg "title" src/form/layouts/DrawerForm -C 3

Repository: ant-design/pro-components

Length of output: 1799


🏁 Script executed:

# Check the full demo file to see the complete DrawerForm usage
cat demos/form/ModalForm/open-on-open-change.tsx | tail -50

Repository: ant-design/pro-components

Length of output: 1241


DrawerForm 应使用直接 title prop 而非 drawerProps 来保持代码简洁

DrawerForm 的 API 支持直接的 title prop (title?: DrawerProps['title']),demo 中不必要地通过 drawerProps={{ title: '...' }} 传递。改用 title="Create New Form" 更清晰,也与 DrawerForm 的一级 API 设计一致。

建议修改为:

<DrawerForm
  onOpenChange={setDrawerVisit}
  title="Create New Form"
  open={drawerVisit}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@demos/form/ModalForm/open-on-open-change.tsx` around lines 115 - 118, 将
DrawerForm 的 title 从 drawerProps 中提取出来,改为直接使用 title prop:在使用的组件 DrawerForm 上移除
drawerProps 中的 title(即不要传 drawerProps={{ title: ... }}),并添加 title="Create New
Form" 同时保留 onOpenChange={setDrawerVisit} 和 open={drawerVisit},确保只使用 DrawerForm
的一级 API(组件名 DrawerForm,属性 title、drawerProps)。

- Updated ModalForm component to ensure modalProps is safely spread, preventing potential errors when modalProps is undefined.
- This change enhances the robustness of the ModalForm implementation.
- Revised the documentation for ModalForm parameters to specify that modalProps should omit the 'open' property.
- Enhanced clarity and consistency in the documentation to align with recent changes in prop usage.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/form/layouts/ModalForm/index.tsx (1)

265-265: modalProps ?? {} 中的空值合并操作是多余的

TypeScript 会静默忽略对 null 或 undefined 值的对象展开操作,因此处理可能未定义的值时无需额外的守卫逻辑。对象展开不关心变量是否为 undefined,会静默处理,而数组展开则会抛出错误。

可以直接简化为 {...modalProps}

♻️ 简化建议
-        {...(modalProps ?? {})}
+        {...modalProps}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/form/layouts/ModalForm/index.tsx` at line 265, The object spread uses an
unnecessary nullish coalescing: replace the expression that spreads modalProps
with a direct spread of modalProps (remove the "?? {}" guard) in the ModalForm
component so JSX uses {...modalProps} instead of {...(modalProps ?? {})}; update
the spread location where modalProps is applied in the ModalForm (index.tsx) to
simplify the code.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/form/layouts/ModalForm/index.tsx`:
- Around line 264-266: The Modal spread removed the previous default width
(width={width || 800}) causing an unintended shrink to antd's default; restore a
default width before spreading modalProps so callers can still override it by
setting modalProps.width. Update the Modal props construction around the Modal
component (symbols: Modal, modalProps, width, open) to set a default width value
(800) and then spread ...(modalProps ?? {}) so modalProps.width, if present,
overrides the default.

---

Nitpick comments:
In `@src/form/layouts/ModalForm/index.tsx`:
- Line 265: The object spread uses an unnecessary nullish coalescing: replace
the expression that spreads modalProps with a direct spread of modalProps
(remove the "?? {}" guard) in the ModalForm component so JSX uses
{...modalProps} instead of {...(modalProps ?? {})}; update the spread location
where modalProps is applied in the ModalForm (index.tsx) to simplify the code.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 19fc74a and 013e1c8.

📒 Files selected for processing (1)
  • src/form/layouts/ModalForm/index.tsx

Comment on lines 264 to 266
<Modal
title={title}
width={width || 800}
{...modalProps}
{...(modalProps ?? {})}
open={open}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

破坏性变更:移除 width 默认值 800px

原实现中存在 width={width || 800},为所有未显式设置宽度的用户提供了 800px 默认值。重构后改为 {...(modalProps ?? {})},若用户未在 modalProps 中指定 width,Modal 将回退到 antd 的默认宽度 520px。这对所有依赖默认 800px 宽度的现有用户来说是不可见的破坏性变更。

建议在 spread 之前声明默认 width,使 modalProps.width 仍可覆盖该默认值:

🐛 修复方案:恢复默认 width
       <Modal
+        width={800}
         {...(modalProps ?? {})}
         open={open}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Modal
title={title}
width={width || 800}
{...modalProps}
{...(modalProps ?? {})}
open={open}
<Modal
width={800}
{...(modalProps ?? {})}
open={open}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/form/layouts/ModalForm/index.tsx` around lines 264 - 266, The Modal
spread removed the previous default width (width={width || 800}) causing an
unintended shrink to antd's default; restore a default width before spreading
modalProps so callers can still override it by setting modalProps.width. Update
the Modal props construction around the Modal component (symbols: Modal,
modalProps, width, open) to set a default width value (800) and then spread
...(modalProps ?? {}) so modalProps.width, if present, overrides the default.

@leshalv
Copy link
Collaborator

leshalv commented Feb 24, 2026

不明白为什么要移除外部api,不兼容升级吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧱 antd form size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants