fix(list-box): preserve typed virtual keys and add HD-09 review repros

This commit is contained in:
maoyingjie
2026-10-29 16:36:02 +08:00
parent ee37e66d37
commit ae27fb28d1
3 changed files with 137 additions and 5 deletions
@@ -24,7 +24,7 @@ import { useInheritedDisabled, disabledContextKey } from "../field/disabled";
import { useCollectionSelection } from "../collection/selection";
import { useCollectionRegistry } from "../collection/registry";
import { collectionOwnerKey } from "../collection/owner";
import { assertKey } from "../collection/keys";
import { assertKey, encodeKey } from "../collection/keys";
import {
listBoxKey,
type ListBoxDataItem,
@@ -284,7 +284,7 @@ const virtualRows = computed<VirtualRow[]>(() => {
(typeof props.rowHeight === "function"
? props.rowHeight(index)
: props.rowHeight) ?? fallbackRowHeight.value;
push({ key: `item-${item.id}`, kind: "item", height, item, index });
push({ key: `item-${encodeKey(item.id)}`, kind: "item", height, item, index });
});
if (slots.loader)
push({ key: "loader", kind: "loader", height: props.loaderHeight });