-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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
组件文档treeSelect第一个例子有错误 #34437
Comments
可以改成非受控的例子 |
不应该改例子,这个是有问题的。#34351 (comment) |
Hello @guiyu1230. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please send your Pull Request to proper branch (feature branch for the new feature, master for bugfix and other changes), fill the Pull Request Template here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution! 你好 @guiyu1230,我们完全同意你的提议/反馈,欢迎直接在此仓库 创建一个 Pull Request 来解决这个问题。请将 Pull Request 发到正确的分支(新特性发到 feature 分支,其他发到 master 分支),务必填写 Pull Request 内的预设模板,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。 |
看起来是受控的 bug |
Trace here: #34351 |
组件value受控属性判断应该是 |
貌似是 React 自身的问题,可以看:https://codesandbox.io/s/dry-shadow-9rgoen?file=/src/App.js |
react 的行为没什么问题, |
|
受控空值应该是 Update: |
那可以使用 null,但是目前 option 里头使用 null 值是合法的需要注意一下,也就是说如果有 value=null 的 option,清空会选中这个 option |
这个没受控。 |
我意思是加个 null 作为显式受控 |
Hmmmm,我有点想起来为啥当年清空做成 |
之前重构的时候我就觉得这个 |
现在 value 还是只让填 |
加到 Task 里,以防忘了 #34087 |
嗯, |
I'm working on it ! 💪 |
Reproduction link
Steps to reproduce
初始state.value为undefined时. 组件虽然设置了value属性但并不受控
文档12行 setValue(value); console打印value. 发现实际上设置的是 setValue(undefined).
导致组件value永远不受控.
What is expected?
修正文档12行的地方. 使用onChange的value参数赋值
What is actually happening?
并没有实现
解决方案: https://codesandbox.io/s/ji-ben-antd-4-19-1-forked-o62h13?file=/index.js
The text was updated successfully, but these errors were encountered: