Skip to content

Commit 06042b4

Browse files
zernoniaclaude
andauthored
fix(ListboxVirtualizer): ignore non-element VNodes in slot children (#2578)
When comment or text nodes are present in the virtualizer slot (e.g. `<!-- @vue-expect-error -->`), the first Fragment child may not be the actual component VNode. Filter by `typeof type !== 'symbol'` to skip Comment, Text, Static, and Fragment VNodes. Closes #2563 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c04bed3 commit 06042b4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/core/src/Listbox/ListboxVirtualizer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const virtualizedItems = computed(() => virtualizer.value.getVirtualItems().map(
8383
})[0]
8484
8585
const targetNode = defaultNode.type === Fragment && Array.isArray(defaultNode.children)
86-
? defaultNode.children[0] as VNode
86+
? defaultNode.children.find(child => typeof (child as VNode).type !== 'symbol') as VNode
8787
: defaultNode
8888
8989
return {

0 commit comments

Comments
 (0)