Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form.Array组件删除表单项后onValuesChange拿到的allValues不是最新值 #6687

Closed
lcylamb opened this issue Jul 31, 2024 · 5 comments · Fixed by #6690
Closed

Form.Array组件删除表单项后onValuesChange拿到的allValues不是最新值 #6687

lcylamb opened this issue Jul 31, 2024 · 5 comments · Fixed by #6690
Labels

Comments

@lcylamb
Copy link

lcylamb commented Jul 31, 2024

Version of antd-mobile

5.37.1

Operating system and its version

No response

Browser and its version

No response

Sandbox to reproduce

https://stackblitz.com/edit/react-3qvhsi?file=demo.tsx

What happened?

demo
在使用Form.Array组件时,添加表单项后(此时数组长度为2),再删除表单项,此时在onValuesChange回调中拿到的allValues不是最新值,期望拿到删除后的数组

Relevant log output

No response

@lcylamb lcylamb added the bug label Jul 31, 2024
@Layouwen
Copy link
Contributor

Version of antd-mobile

5.37.1

Operating system and its version

No response

Browser and its version

No response

Sandbox to reproduce

https://stackblitz.com/edit/react-3qvhsi?file=demo.tsx

What happened?

demo 在使用Form.Array组件时,添加表单项后(此时数组长度为2),再删除表单项,此时在onValuesChange回调中拿到的allValues不是最新值,期望拿到删除后的数组

Relevant log output

No response

image

复现地址是不是填错了, 打开跟上面内容不一样

@lcylamb
Copy link
Author

lcylamb commented Jul 31, 2024

Version of antd-mobile

5.37.1

Operating system and its version

No response

Browser and its version

No response

Sandbox to reproduce

https://stackblitz.com/edit/react-3qvhsi?file=demo.tsx

What happened?

demo 在使用Form.Array组件时,添加表单项后(此时数组长度为2),再删除表单项,此时在onValuesChange回调中拿到的allValues不是最新值,期望拿到删除后的数组

Relevant log output

No response

image

复现地址是不是填错了, 打开跟上面内容不一样

是的,不好意思我复制错了,这是正确的地址https://codesandbox.io/s/new-sound-wn93j9

@lcylamb
Copy link
Author

lcylamb commented Aug 1, 2024

1722496965718.mp4

可以查阅本视频

@Layouwen
Copy link
Contributor

Layouwen commented Aug 1, 2024

1722496965718.mp4
可以查阅本视频

#6690 该问题已经修复了, 可以等后续发版后更新一下版本~

@lcylamb
Copy link
Author

lcylamb commented Aug 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants