feat(collection): add optional filtering and virtual focus for composite pickers

ComboBox and Autocomplete need two capabilities the collection protocol did not
express: filtering a collection by an external input value, and keeping DOM focus
in the composite's input while an active option is tracked for
aria-activedescendant.

Both are opt-in members on CollectionOwner plus optionId/reveal on the owned
collection. Standalone ListBox and Select provide none of them and keep their
previous behaviour: DOM focus still moves into the list, one roving tab stop, no
row filtering.

Filtered rows stay mounted with data-filtered (display:none) so their text and
accepted selection survive; only display, aria positions and keyboard navigation
see the visible subset. Under virtual focus the list never takes DOM focus,
never exposes a roving tab stop, and leaves keyboard handling to the composite;
reveal() scrolls a virtualized window and waits for the row to mount before the
composite reads its id.

Includes the playground verification page, a ten-case suite and the B02a section
of the migration report.
This commit is contained in:
maoyingjie
2026-10-25 14:53:49 +08:00
parent fa73cafd20
commit 1b972a78ba
11 changed files with 849 additions and 30 deletions
+5
View File
@@ -13,6 +13,10 @@ const animationLab =
typeof window !== "undefined" &&
new URLSearchParams(window.location.search).has("overlay-animation");
import OverlayLab from "./OverlayLab.vue";
import FilterVirtualLab from "./FilterVirtualLab.vue";
const filterVirtualLab =
typeof window !== "undefined" &&
new URLSearchParams(window.location.search).has("filter-virtual");
import OverlayComponentsLab from "./OverlayComponentsLab.vue";
const componentsLab =
typeof window !== "undefined" &&
@@ -36,6 +40,7 @@ function save() {
<OverlayAnimationLab v-else-if="animationLab" />
<OverlayComponentsLab v-else-if="componentsLab" />
<OverlayLab v-else-if="overlayLab" />
<FilterVirtualLab v-else-if="filterVirtualLab" />
<div v-else class="lab" :data-theme="dark ? 'dark' : 'light'">
<header>
<a class="wordmark" href="#">