ant-design
ant-design copied to clipboard
Cascader 使用 disabled、showSearch 还可以被搜索
Reproduction link
Steps to reproduce
输入框搜索 nanjing
What is expected?
nanjing 不可选中
What is actually happening?
可以选中
| Environment | Info |
|---|---|
| antd | 4.22.7 |
| React | latest |
| System | mac |
| Browser | edge |
nanjing 和 zhonghuamen 没有被禁用,默认选择策略下禁用 zhonghuamen 就能达到预期了
nanjing 和 zhonghuamen 没有被禁用,默认选择策略下禁用 zhonghuamen 就能达到预期了
是否可选中,跟搜索选中,目前交互不一致。是否要统一
禁用是否要连坐
和选择策略有关,不能一概而论了,理想情况是 disabled 还要合选择策略相关联,有些复杂了。
我觉得 options 里还是所见即所得比较好。
一级不能选,他的下面肯定不能选,我不知道当时策略怎么定的,为什么选择的时候,逻辑是ok的,但是搜索给放开了
考虑了一下,应该还是是搜索时看看父节点有没有被禁用,本身 disabled 就不用继承下去了。
Hello, I am trying to fix this issue.
In defaultSearchRender(), I add an if statement in the loop to check if node has a property disabled, if it is true, then break the loop.
Hello, I am trying to fix this issue.
Feel free to send us PR~
Hello, I am trying to fix this issue.
Feel free to send us PR~
kindly review my PR, thank ~