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

[Tree] 叶子节点与非叶子节点的点击事件表现不一致 #2444

Closed
FountainShaw opened this issue Aug 15, 2023 · 4 comments
Closed
Assignees
Labels

Comments

@FountainShaw
Copy link

tdesign-react 版本

1.1.17

重现链接

https://codesandbox.io/s/6w53wt?file=/src/demo.jsx

重现步骤

点击Tree组件中的任意叶子节点和非叶子节点除图表外的地方

期望结果

expandOnClickNode = true 时,非叶子节点展开或收起,叶子节点不做反馈
expandOnClickNode = false 时,非叶子节不做反馈,叶子节点不做反馈

实际结果

expandOnClickNode = true 时,非叶子节点展开或收起,叶子节点被选中或取消选中
expandOnClickNode = false 时,非叶子节不做反馈,叶子节点选中或取消选中

框架版本

react(18.2.0)

浏览器版本

No response

系统版本

No response

Node版本

v14.18.1

补充说明

这个问题是叶子节点与非叶子节点在点击整个节点区域时,同样都是checkbox,但表现出的效果不一致,这会让使用者感到困惑

@github-actions
Copy link
Contributor

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

@FountainShaw FountainShaw changed the title [组件名称] 描述问题的标题 [Tree] 叶子节点与非叶子节点的点击事件表现不一致 Aug 16, 2023
@github-actions
Copy link
Contributor

♥️ 有劳 @shryzhang @lysongzi @Ruoleery @uyarn 尽快确认问题。
确认有效后将下一步计划和可能需要的时间回复给 @FountainShaw

@uyarn
Copy link
Collaborator

uyarn commented Nov 2, 2023

expandOnClickNode 只和展开功能有关 与选中无关;expandOnClickNode本身在1.1.17版本有一些问题 1.3.0修复过了

@uyarn
Copy link
Collaborator

uyarn commented May 16, 2024

再补充说明一下
expandOnClickNode = true 时,非叶子节点展开或收起,叶子节点被选中或取消选中
expandOnClickNode = false 时,非叶子节不做反馈,叶子节点选中或取消选中
是目前预期的结果,叶子节点因为没有子节点了,所以用户点击的目的就是选中它,不存在其他可能;
非叶子节点,用户可能是想选中也可能是展开子节点,所以这里提供的expandOnClickNode配置就是方便具体业务根据实际需要决定点击节点的交互效果

@uyarn uyarn closed this as completed May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants