ant-design / ant-design/pro-components
🐛[BUG]在Schema Form中使用'表单集合'(valueType=’formSet‘)时,父组件与子组件的initialValue没有同步赋值
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 3
Description
### 🐛 bug 描述
在Schema Form中使用'表单集合'(valueType=’formSet‘)时,如果给父组件设置了initialValue,并给其下的子组件设置为必填,虽然在页面呈现上所有子组件均已填入内容,但直接提交会提示所有子组件为空;同样的,如果只给所有子组件设置initialValue,在不修改内容的前提下提交表单,在onFinish里观察到父组件并没有赋值。
### 📷 复现步骤
[codesandbox](https://codesandbox.io/p/sandbox/schema-biao-dan-forked-7jpdcr)
### 🏞 期望结果
formSet中的父组件与子组件的initialValue能双向同步
### 💻 复现代码
[codesandbox](https://codesandbox.io/p/sandbox/schema-biao-dan-forked-7jpdcr)
### © 版本信息
- ProComponents 版本: 2.6.50
- 浏览器环境 Chrome 124.0.6367.63
- 开发环境 Windows 11
### 🚑 其他信息

Contributor guide
Research direction
Start by running the linked CodeSandbox reproduction for Schema Form with valueType='formSet', then inspect the formSet handling and its initialValue behavior. Verify the fix by checking that parent and child initial values stay synchronized and that submission no longer reports required children as empty or omits the parent value in onFinish.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100