Revert "fix(space): vnode reuse problem caused by filtering out comment vnodes of slot (#5150)"

This reverts commit 597fd57c49.
This commit is contained in:
equt 2023-08-23 15:50:15 +08:00 committed by GitHub
parent 597fd57c49
commit 731325a3d7
4 changed files with 3 additions and 6 deletions

View File

@ -32,8 +32,7 @@
- Fix `n-tree`'s `TreeOption`'s `checkboxDisabled` prop doesn't work when `check-on-click` is `true`.
- Fix rapid clicks on `n-date-input`'s buttons triggering a text select for the rest of the website.
- Fix `n-auto-complete`'s autocomplete menu's unexpected open when clicking the clear icon with the input not focused, closes [#4658](https://github.com/tusen-ai/naive-ui/issues/4658).
- Fix `n-input`'s `on-keyup` prop type, closes [#5101](https://github.com/tusen-ai/naive-ui/issues/5101).
- Fix `n-space` vnode reuse problem caused by filtering out comment vnodes of slot, closes [#5136](https://github.com/tusen-ai/naive-ui/issues/5136).
- Fix `n-input`'s `on-keyup` prop type, closes [#5101](https://github.com/tusen-ai/naive-ui/issues/5101)
### Features

View File

@ -33,7 +33,6 @@
- 修复 `n-date-input` 的按钮快速点击时网站其余文本会被选中
- 修复 `n-auto-complete` 在未聚焦状态下点击清除按钮时补全菜单意外打开的问题,关闭 [#4658](https://github.com/tusen-ai/naive-ui/issues/4658)
- 修复 `n-input` 属性 `on-keyup` 类型,关闭 [#5101](https://github.com/tusen-ai/naive-ui/issues/5101)
- 修复 `n-space` 插槽过滤了注释节点导致节点复用问题,关闭 [#5136](https://github.com/tusen-ai/naive-ui/issues/5136)
### Features

View File

@ -30,8 +30,7 @@ export function flatten (
flatten(vNode.children, filterCommentNode, result)
}
// rawSlot
} else {
if (vNode.type === Comment && filterCommentNode) return
} else if (vNode.type !== Comment) {
result.push(vNode)
}
})

View File

@ -123,7 +123,7 @@ export default defineComponent({
wrapItem,
internalUseGap
} = this
const children = flatten(getSlot(this), false)
const children = flatten(getSlot(this))
if (!children.length) return null
const horizontalMargin = `${margin.horizontal}px`
const semiHorizontalMargin = `${margin.horizontal / 2}px`