-
Notifications
You must be signed in to change notification settings - Fork 594
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
[Field]Field 表单辅助工具设置值不生效 bug #4525
Comments
按照目前的 parseName=true 对于setValues的设计 ( shallow merge and keep old field values ),你这个情况是符合预期的,清空数据可以使用 reset() 方法 |
@YSMJ1994 但是旧版本是可以这么设置的, 这样不是会出现很多问题吗 |
近期的版本确实是有不一致的问题,我看一下 |
@Liting1 排查到的问题是以前的逻辑针对非undefined值会直接使用新的值来替换,你设置的 null 和 "" 正好符合了这个规则,所以覆盖了原有field的值,最近一次改动调整了这块逻辑,通过hasIn判断就走进了错误的逻辑。 |
Replay demo: https://riddle.alibaba-inc.com/riddles/aa564e4b |
Fixed at @alifd/field@1.6.7 |
注:@alifd/next 包 version 1.26.31 有问题,
以前的旧版本包就没有 例如 1.26.18 版本就是正常的
Component
Field
以上代码就能复现 先点按钮1 , 再点按钮2 就能看到
@YSMJ1994 我目测原因出在 @alifd/field 这个包的这个地方
![image](https://private-user-images.githubusercontent.com/33544236/282701113-d77bf3f6-1461-4a1e-af3a-02d3101f6cb8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NDA5MjMsIm5iZiI6MTczOTQ0MDYyMywicGF0aCI6Ii8zMzU0NDIzNi8yODI3MDExMTMtZDc3YmYzZjYtMTQ2MS00YTFlLWFmM2EtMDJkMzEwMWY2Y2I4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDA5NTcwM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg3MGU3ZDRmOTRhNGEwZGIxNjE2ODQ1Yzg5OTI0OTgyYmI4MWEyNGUwMjZlMGY4Njc1YjFjNzc2NmU3N2RiZGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.QNAlla5ZHgXgXMEQEqK9CA7qNI3wGjtERkb-JloAA2I)
The text was updated successfully, but these errors were encountered: