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

fix: Form should not trigger unnecessary onFieldsChange #43292

Merged
merged 1 commit into from Jun 30, 2023
Merged

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Jun 30, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

Same as #43290 fixes #43276 but for v4
Maybe also fix #43240
close #43249

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Form submit trigger wrong onFieldsChange event even all the fields do not config rules. And Form.List nested Form event bubble not correct.
🇨🇳 Chinese 修复 Form 在提交时,字段没有配置 rules 时仍会错误触发 onFieldsChange 事件的问题。以及嵌套 Form.List 嵌套 Form 的场景下,事件触发不正确的问题。

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

🤖 Generated by Copilot at 2ec80a9

Updated a script and a dependency for the package. The script scripts/post-script.js now supports a new deprecated version for the conch tag. The dependency rc-field-form was upgraded to a newer version to fix some issues and enhance the form component.

🔍 Walkthrough

🤖 Generated by Copilot at 2ec80a9

  • Update rc-field-form dependency version to fix bugs and improve performance (link)
  • Add 4.24.11 to deprecated versions and provide reason related to rc-field-form bug (link)
  • Wrap arrow function parameters in parentheses to follow code style and linting rules (link, link, link, link, link, link)
  • Fetch, filter, sort, format, and generate choices for package versions from registry in scripts/post-script.js (link, link, link, link, link)
  • Prompt user to select a version for the conch tag and log deprecation reasons in scripts/post-script.js (link, link)

@github-actions
Copy link
Contributor

github-actions bot commented Jun 30, 2023

@socket-security
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
rc-field-form 1.33.0 None +0 257 kB afc163

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
./dist/antd.min.js 281.98 KB (+92 B 🔺)
./dist/antd.min.css 66.31 KB
./dist/antd.dark.min.css 67.55 KB
./dist/antd.compact.min.css 66.26 KB
./dist/antd.variable.min.css 66.84 KB

@codecov
Copy link

codecov bot commented Jun 30, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (9a4ee2e) 100.00% compared to head (2ec80a9) 100.00%.

Additional details and impacted files
@@             Coverage Diff              @@
##           4.x-stable    #43292   +/-   ##
============================================
  Coverage      100.00%   100.00%           
============================================
  Files             450       450           
  Lines            8347      8347           
  Branches         2540      2540           
============================================
  Hits             8347      8347           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@zombieJ zombieJ merged commit 67ff988 into 4.x-stable Jun 30, 2023
112 checks passed
@zombieJ zombieJ deleted the form-field branch June 30, 2023 05:43
@zombieJ zombieJ mentioned this pull request Jun 30, 2023
16 tasks
@hhhluke
Copy link

hhhluke commented Jul 3, 2023

更新到4.24.12后,form组件卡炸了,主要是自定义组件的onChange事件导致,
怀疑最近这几个版本的pr有问题,回退到4.24.11是ok的,辛苦排查下 @yoyo837 @MadCcc

@afc163
Copy link
Member

afc163 commented Jul 3, 2023

@hhhluke 帮忙给个重现我们排查一下。

@margintopt
Copy link

margintopt commented Sep 26, 2023

@afc163
4.24.12 <Form.List> 使用 initialValue 后

以下为官网实例 动态增减嵌套字段

 <Form.List name="users" initialValue={[{ first: '123', last: '44' }]}>

再次调用这个方法,会将fields重置为null

form.setFieldsValue([{ first: '123', last: '44' }]);

复杂的动态增减表单项

发现这个控件的Area控件选择后也会触发

@shaoqiwang-fe
Copy link

更新到4.24.12后,form组件卡炸了,主要是自定义组件的onChange事件导致, 怀疑最近这几个版本的pr有问题,回退到4.24.11是ok的,辛苦排查下 @yoyo837 @MadCcc

太卡了,而且还栈溢出了。。。

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

Successfully merging this pull request may close these issues.

None yet

7 participants