ant-design/ant-design-mobile

Form.List 中的某一项删除后,其他字段也被意外影响了

Open

#5609 opened on Aug 22, 2022

View on GitHub
 (5 comments) (1 reaction) (0 assignees)TypeScript (11,238 stars) (2,313 forks)batch import
bughelp wanted

Description

Version of antd-mobile

5.22.0

Operating system and its version

Others

Browser and its version

Chrome

Sandbox to reproduce

https://stackblitz.com/edit/react-ts-ufnhw9?file=App.tsx

What happened?

复现方法是:

  1. 打开上面的 demo
  2. 点添加按钮,添加三项内容,并分别输入一些值
  3. 删除第二项
  4. 发现此时第三项的值也异常了

预期行为:

点击删除之后,第三项的值保持不变,仅第二项被删除掉

额外一点补充:

把 Form 上的 preserve={false} 去掉就行为正常了 疑似 rc-field-form 的问题

Relevant log output

No response

Contributor guide