Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Auto-Layout 未在 ModalForm/DrawerForm 等表单变体中生效,始终为单列表单 #616

Closed

Description

@hotlong

问题描述

在 ObjectUI 平台,实现了元数据驱动的 Auto-Layout 功能,SimpleObjectForm 能正确推断多字段时采用两列布局。但在实际使用(如创建联系人弹窗)发现:

  • 不论 Contact 字段多少,界面仍始终是单列平铺。
  • Modal 弹窗/Drawer 侧滑等表单变体未自动应用 Auto-Layout,用户体验与产品需求不符。
Create Contact 弹窗效果截图

复现路径

  • 创建/编辑 Contact 等对象,字段较多,弹窗或侧滑表单打开时。
  • 预期:根据字段数量智能切换 1-2 列,并为宽字段做 colSpan。
  • 实际:始终 1 列平铺,未分栏。

分析排查

  • SimpleObjectForm 已集成 applyAutoLayout,auto-layout 逻辑本身无误。
  • 但 ObjectForm 代码中,ModalForm、DrawerForm、TabbedForm、WizardForm、SplitForm 变体直接将 formFields/schema.columns 透传到 renderer,未调用 applyAutoLayout。导致 columns 始终为 1 或 undefined。
  • 无论 schema.columns 是否设置,平台级 auto-layout 推断入口缺失,需要修复。

相关代码位置

修复建议

  • 在所有表单变体(ModalForm、DrawerForm、TabbedForm、WizardForm、SplitForm)渲染前补充 applyAutoLayout 步骤。
  • 未显式配置 columns/colSpan/sections 时,接管并自动推断 columns/colSpan。
  • 保持和 SimpleObjectForm 一致体验。

受影响版本

  • 当前 main 分支及近期所有构建

关联

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

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions