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

[TreeSelect] 无法满足仅允许选中叶子节点 #558

Closed
scope9Ri opened this issue Mar 15, 2022 · 8 comments
Closed

[TreeSelect] 无法满足仅允许选中叶子节点 #558

scope9Ri opened this issue Mar 15, 2022 · 8 comments
Labels
to be published fixed, not be published

Comments

@scope9Ri
Copy link

这个功能解决了什么问题

在某些场景下TreeSelect仅允许选中子节点,当前API控制粒度无法满足该场景。

你建议的方案是什么

允许开发者控制各节点是否选中。当节点不允许选中时,点击该节点也不应收起pupup

@github-actions
Copy link
Contributor

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

@scope9Ri scope9Ri changed the title [TreeSelect] 点击节点不收起popup [TreeSelect] 无法满足仅允许选中叶子节点 Mar 15, 2022
@chaishi
Copy link
Collaborator

chaishi commented Mar 15, 2022

使用 Tree.valueMode,即 treeProps={ valueMode } 控制选中项的值

如果无法控制,请提供复现问题的 Demo

@scope9Ri
Copy link
Author

tree属性透传无法实现该需求,https://codesandbox.io/s/tdesign-vue-demo-forked-o9wklr
实际期望是控制当仅允许子节点选中时的交互

@chaishi
Copy link
Collaborator

chaishi commented Mar 15, 2022

具体什么交互,需求描述详细些,不太明白

@Inori-Lover
Copy link

具体什么交互,需求描述详细些,不太明白

目前treeSelect多选情况下仍然点击一次后就收起;官网example可复现

@scope9Ri
Copy link
Author

业务方使用时存在一种特殊情况:仅允许叶子结点被点击选中,而非叶子结点不允许选中。当前不论是叶子结点还是非叶子节点选中时popup都会被收起。我们期望在这种情况下,点击非叶子结点时,不触发change事件,popup不收起。

@chaishi
Copy link
Collaborator

chaishi commented Mar 15, 2022

合理需求,我找人处理下。多选情况,点击浮层内容任意位置任意元素,不收起浮层

@xiaosansiji
Copy link
Collaborator

已在 0.38.0 版本中修复

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

No branches or pull requests

5 participants