fix(collection): close the six review gaps in filtering and virtual focus

- Keep the composite input focused on real pointer presses: cancel the default
  focus transfer for plain row presses only, leaving nested controls and already
  cancelled callers alone.
- Drive the virtual window, total height, reveal index and aria positions from
  the visible subset, and render the empty channel when filtering removes every
  row. Non-virtualized rows stay mounted and are hidden, so their text and
  accepted selection survive.
- Scroll mounted rows for reveal/focus outside virtualization, wait for a
  virtualized row to mount (frame-based, bounded), and drop reveal requests that
  filtering, closing or unmounting made obsolete.
- Stop overwriting caller `hidden`: mergeProps deletes an earlier key when a
  later value is undefined, so the filter now only adds `hidden` when the caller
  did not set it.
- Share keyboard modality through an optional `keyboardIntent` ref so a pointer
  press no longer leaves the active row without data-focus-visible.
- Give the verification harness instance-unique ids and derive
  aria-activedescendant from open state, mounted id and filter visibility.

Adds the reviewer probe plus eight regressions, and a virtualized harness
instance for the browser smoke of filtering plus window/height/positions.
This commit is contained in:
maoyingjie
2026-10-25 16:28:33 +08:00
parent 1b972a78ba
commit 50ad3ca180
9 changed files with 511 additions and 55 deletions
+14
View File
@@ -5,6 +5,11 @@
* This is a harness, not a public component.
*/
import FilterVirtualCombobox from "../../../packages/vue/tests/fixtures/FilterVirtualCombobox.vue";
const manyOptions = Array.from({ length: 40 }, (_, index) => ({
id: `row-${index}`,
text: `第 ${index} 行`,
}));
</script>
<template>
@@ -37,5 +42,14 @@ import FilterVirtualCombobox from "../../../packages/vue/tests/fixtures/FilterVi
<h2 style="font-size: 15px; font-weight: 600">3. 不过滤(对照)</h2>
<FilterVirtualCombobox :filter-enabled="false" />
</section>
<section style="display: grid; gap: 8px">
<h2 style="font-size: 15px; font-weight: 600">4. 虚拟窗口 + 过滤</h2>
<p style="font-size: 13px; color: var(--muted)">
40 行数据,只渲染可见 4 行;输入“1”过滤后窗口、总高度与 posinset/setsize
都应随可见集合收缩。
</p>
<FilterVirtualCombobox :options="manyOptions" :virtualized="true" />
</section>
</main>
</template>