feat: migrate ListBox with virtual collection and accessible parts

This commit is contained in:
maoyingjie
2026-10-23 15:02:30 +08:00
parent dea5ded716
commit 65db60a7ac
39 changed files with 2694 additions and 12 deletions
+9 -1
View File
@@ -10,6 +10,7 @@ withDefaults(
multiple?: boolean;
disabled?: boolean;
name?: string;
cancelNavigation?: boolean;
}>(),
{ modelValue: undefined, defaultValue: undefined },
);
@@ -26,7 +27,14 @@ const emit = defineEmits<{ "update:modelValue": [value: unknown] }>();
:name="name"
@update:model-value="emit('update:modelValue', $event)"
>
<ListboxContent aria-label="Audit choices">
<ListboxContent
aria-label="Audit choices"
@keydown="
(event: KeyboardEvent) => {
if (cancelNavigation) event.preventDefault();
}
"
>
<ListboxItem :value="0">Numeric zero</ListboxItem>
<ListboxItem value="0">String zero</ListboxItem>
<ListboxItem value="disabled" disabled>Disabled</ListboxItem>