fix(tree): use render-switcher-icon prop will cause node selection, closes #5380 (#5381)

Co-authored-by: 07akioni <07akioni2@gmail.com>
This commit is contained in:
吉仔 2023-12-03 18:40:55 +08:00 committed by GitHub
parent 84151042a8
commit 676f2d6649
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View File

@ -8,6 +8,7 @@
- Fix `n-tree` The style of the selected node is not displayed in the case of 'disabled'. - 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-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-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)
- Fix `n-input` will display the password reveal button by default when the `type` is set to `password`. Starting with Microsoft Edge browser Version 87. closes [#5384](https://github.com/tusen-ai/naive-ui/issues/5384). - Fix `n-input` will display the password reveal button by default when the `type` is set to `password`. Starting with Microsoft Edge browser Version 87. closes [#5384](https://github.com/tusen-ai/naive-ui/issues/5384).
- Fix `n-radio-button` css var `buttonColor` not working. - Fix `n-radio-button` css var `buttonColor` not working.
- Fix `n-input` not display vertical scrollbar when `type` is `textarea` and the inline theme is disabled, closes [#5418](https://github.com/tusen-ai/naive-ui/issues/5418). - Fix `n-input` not display vertical scrollbar when `type` is `textarea` and the inline theme is disabled, closes [#5418](https://github.com/tusen-ai/naive-ui/issues/5418).

View File

@ -8,6 +8,7 @@
- 修复 `n-tree``disabled` 的情况下不显示选中节点的样式 - 修复 `n-tree``disabled` 的情况下不显示选中节点的样式
- 修复 `n-tree` `virtual-scroll` 空数据占位符丢失 - 修复 `n-tree` `virtual-scroll` 空数据占位符丢失
- 修复 `n-watermark` 组件中的 `content` 属性为空时,无法清空水印内容 - 修复 `n-watermark` 组件中的 `content` 属性为空时,无法清空水印内容
- 修复 `n-tree` 自定义不同的展开开关图标时会导致节点选中,关闭[#5380](https://github.com/tusen-ai/naive-ui/issues/5380)
- 修复 `n-input` 从 Edge 浏览器 87 版本开始,`type` 为 `password` 时默认样式会多出一个显示密码按钮,关闭[#5384](https://github.com/tusen-ai/naive-ui/issues/5384) - 修复 `n-input` 从 Edge 浏览器 87 版本开始,`type` 为 `password` 时默认样式会多出一个显示密码按钮,关闭[#5384](https://github.com/tusen-ai/naive-ui/issues/5384)
- 修复 `n-radio-button` 主题变量 `buttonColor` 设置不生效 - 修复 `n-radio-button` 主题变量 `buttonColor` 设置不生效
- 修复 `n-input``type``textarea` 且禁用 inline 主题时不显示纵向滚动条,关闭 [#5418](https://github.com/tusen-ai/naive-ui/issues/5418) - 修复 `n-input``type``textarea` 且禁用 inline 主题时不显示纵向滚动条,关闭 [#5418](https://github.com/tusen-ai/naive-ui/issues/5418)

View File

@ -77,7 +77,8 @@ const TreeNode = defineComponent({
contentElRef.value = contentInstRef.value!.$el as HTMLElement contentElRef.value = contentInstRef.value!.$el as HTMLElement
}) })
function handleSwitcherClick (): void { function handleSwitcherClick (e?: MouseEvent): void {
e?.stopPropagation()
const { tmNode } = props const { tmNode } = props
if (!tmNode.isLeaf && !tmNode.shallowLoaded) { if (!tmNode.isLeaf && !tmNode.shallowLoaded) {
if (!NTree.loadingKeysRef.value.has(tmNode.key)) { if (!NTree.loadingKeysRef.value.has(tmNode.key)) {