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
antd树形穿梭框有bug,使用默认的非checkStrictly模式,选中父节点,子节点无法取消选择 #18863
Comments
ref: #18753 |
这个问题困扰了我一整天,codesandbox展示的仅仅是antd官网里面的树形穿梭框demo,我仅仅是将checkStrictly去掉,就导致父节点点击以后,所有的子节点无法取消选择状态, 然而这时候再点击父节点后,子节点又能选择和取消选择了. |
对于非 |
Hello @LastStranger, we use GitHub issues to trace bugs or discuss plans of Ant Design. So, please don't ask usage questions here. You can try to ask questions on Stack Overflow or Segment Fault, then apply tag 你好 @LastStranger,Ant Design Issue 板块是用于 bug 反馈与需求讨论的地方。请勿询问如何使用的问题,你可以试着在 Stack Overflow 或者 Segment Fault 中提问(记得添加 |
遇到类似的问题, 需要从一个已经存在列表中移除选中的元素, 此选中的元素的父亲节点是选中状态, 非checkStrictly模式, 通过 const [checkedKeys, setCheckedKeys] = useState([])来维护选中的状态。 当清空子节点对应的checkedKey 需要将父节点的选中状态也清空,否则UI无法生效。 ` const findParentIds = (tree, targetId) => {
} |
Reproduction link
Steps to reproduce
点击父节点,子节点被选中,但再次点击子节点的时候,无法取消子节点的选择状态,
What is expected?
取消子节点的选择状态
What is actually happening?
没有任何反应,数据已经改变了,但是UI视觉是没有改变的
我仅仅是将https://ant.design/components/transfer-cn/#header里面的树形穿梭框demo里面的checkStrictly去掉,就有这个问题了
The text was updated successfully, but these errors were encountered: