Skip to content

Commit

Permalink
fix(tree): use render-switcher-icon prop will cause node selection, c…
Browse files Browse the repository at this point in the history
…loses tusen-ai#5380
  • Loading branch information
jizai1125 committed Nov 13, 2023
1 parent 86e72ce commit 84f96b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Fix `n-tree` The style of the selected node is not displayed in the case of 'disabled'.
- Fix `n-tree` on `virtual-scroll` empty data placeholder lost problem.
- Fix `n-watermark` won't clear it's content when `content` prop is set to empty.
- Fix `n-tree` use `render-switcher-icon` prop to customize switcher icon will cause node selection, closes [#5380](https://github.com/tusen-ai/naive-ui/issues/5380)

### Features

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- 修复 `n-tree``disabled` 的情况下不显示选中节点的样式
- 修复 `n-tree` `virtual-scroll` 空数据占位符丢失
- 修复 `n-watermark` 组件中的 `content` 属性为空时,无法清空水印内容
- 修复 `n-tree` 自定义不同的展开开关图标时会导致节点选中,关闭[#5380](https://github.com/tusen-ai/naive-ui/issues/5380)

### Features

Expand Down
3 changes: 2 additions & 1 deletion src/tree/src/TreeNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ const TreeNode = defineComponent({
contentElRef.value = contentInstRef.value!.$el as HTMLElement
})

function handleSwitcherClick (): void {
function handleSwitcherClick (e?: MouseEvent): void {
e?.stopPropagation()
const { tmNode } = props
if (!tmNode.isLeaf && !tmNode.shallowLoaded) {
if (!NTree.loadingKeysRef.value.has(tmNode.key)) {
Expand Down

0 comments on commit 84f96b5

Please sign in to comment.