fix: complete submenu panel ARIA, focus and event passthrough
- Submenu panel name priority is explicit aria-label > menu content channel > this instance's trigger; an explicit label drops the id reference so it cannot be shadowed. - openAutoFocus and animationend chain with the caller's handlers like keydown and interact-outside, so caller callbacks run and can cancel. - The panel loop falls back to the menu-level shouldFocusWrap and is always passed as a boolean: an undefined -> true update is dropped by the base prop chain, so the menu policy never applied. - Add a jsdom CSSOM polyfill for CSS.escape via vitest setupFiles; the animationend test no longer raises an unhandled error.
This commit is contained in:
@@ -971,3 +971,13 @@ Button/PopoverTrigger/Link/ToggleButtonGroup 源码及几何复核后,移除
|
||||
- **R9 子菜单参数**:面板属性补齐 `data-*`/`style`/`id`/其他事件透传;`isKeyboardDismissDisabled` 生效(Esc 既不关子层也不关父层,新增回归),`shouldCloseOnInteractOutside` 接到子面板的 outside 链路。
|
||||
- **R8 独立 Menu 名称**:独立路径自身提供内容属性通道,`aria-label`/`aria-labelledby`/`aria-describedby` 落在真正的 `role="menu"` 节点(回归 `Standalone actions` 通过),静态布局与无滚动锁保持不变。
|
||||
- 回归:**72 文件 / 928 项**通过(含新增 4 项自有回归:根面板事件合并、调用方取消 Escape、子面板禁止 Esc、菜单策略优先于分组模式);typecheck、Prettier 通过;独立 tarball 消费重跑通过;浏览器复验默认动作关闭与三级子菜单逐层 Esc。
|
||||
|
||||
### B01 b474a63 复核返修(同日)
|
||||
|
||||
按 [b474a63 复核记录](migrations/B01-b474a63-review.md) 处理 R9 子面板透传的 3 个分支与 1 项测试环境异常;探针 **23/23**。
|
||||
|
||||
- **子面板 ARIA**:名称优先级为「面板显式 `aria-label` → Menu 内容通道 → 本实例触发器 id」,显式名称存在时移除 `aria-labelledby`,不再被 id 引用压过。探针里 `Direct submenu name` 与 `explicit-description` 均保留。
|
||||
- **子面板事件合并**:`onOpenAutoFocus`、`onAnimationend` 与 `onKeydown`、`onInteractOutside` 一样改为「调用方 + 内部」数组链,调用方先执行并按 `defaultPrevented` 取消;`openAutoFocus` 调用次数回归通过。
|
||||
- **子菜单 `shouldFocusWrap`**:面板 `loop` 回退到菜单级配置,并统一传布尔值——实测底座属性链会丢弃 `undefined → true` 的更新(`false → true` 生效),因此不能传 `undefined`。双向首尾循环回归通过。
|
||||
- **测试环境**:jsdom 缺少 `CSS`,Reka Presence 在 `animationend` 时会调用 `CSS.escape` 抛未捕获错误。新增 `tests/setup/cssom.ts` 仅在缺失时补齐该能力并注册到 `setupFiles`,未关闭错误检查、未吞异常、未改产品行为;单跑与全量都不再有 Unhandled Errors。
|
||||
- 回归:**72 文件 / 931 项**通过(无未捕获错误);typecheck、Prettier、`git diff --check` 通过;未重做逐像素/读屏/物理触屏,仍按未验收记录。
|
||||
|
||||
Reference in New Issue
Block a user