ant-design / ant-design/pro-components
🐛[BUG] ProFormList嵌套ProFormList无法正确删除
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 3
Description
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
### 🐛 bug 描述
当ProFormList嵌套ProFormList,且有initialValues,且ProForm配置了preserve为false时,删除到最后一个元素后会生成一个空对象
### 📷 复现步骤
1. 访问复现代码链接, 点击删除
2. 点击第二行的删除后无法正确删除
### 🏞 期望结果
能正常删除所有数据
### 💻 复现代码
https://codesandbox.io/s/proform-list-proformlist-forked-bok1c2?file=/App.tsx
### © 版本信息
- ProComponents 版本: 2.4.2
- 浏览器环境 chrome
### 🚑 其他信息
1. 非嵌套结构一切正常
2. initialValue中 没有嵌套的空数组也正常
3. 使用Antd Form还原相同场景无法重现 (附Antd Form的代码 https://codesandbox.io/s/fu-za-de-dong-tai-zeng-jian-biao-dan-xiang-antd-5-3-2-forked-vc7et4?file=/demo.tsx)
Contributor guide
Research direction
Start with the linked CodeSandbox App.tsx and reproduce the nested ProFormList case using initialValues and preserve=false. Compare it with the linked Ant Design Form example to isolate the ProFormList behavior; done means deleting the final nested item leaves no empty object and removes all data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100