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] FormItem 劫持第一层受控组件的逻辑,是否可以优化成有 name 字段的时候才劫持 #3268

Open
libo1106 opened this issue Dec 5, 2024 · 1 comment
Labels
💭 discussion we are discussing

Comments

@libo1106
Copy link

libo1106 commented Dec 5, 2024

这个功能解决了什么问题

明确了 Form.Item 是否要劫持第一层组件的 valueonChange,不需要写额外多一个无意义的 <div>

现在 FAQ 里面的前两点,看上去都是同一个问题

Clipboard_Screenshot_1733391496

你建议的方案是什么

当 FormItem 不存在 name 属性的时候,不进行劫持,因为此时没有对应的 form keyName 可用于收集。
当 FormItem 存在 name 属性的时候,才自动劫持第一层的 value,维持当前逻辑。

Copy link
Contributor

github-actions bot commented Dec 5, 2024

👋 @libo1106,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@uyarn uyarn added the 💭 discussion we are discussing label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💭 discussion we are discussing
Projects
None yet
Development

No branches or pull requests

2 participants