Files
heroui-vue/docs/migrations/B01-complete-review-2.md
T
maoyingjie 2e4b376537 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.
2026-10-25 00:01:24 +08:00

49 lines
4.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# B01 整批清单返修复核(53b4639)
2026-10-24;独立worktree heroui-vue-b01,检查提交53b4639。结论:暂不通过。范围仍是上一份整批清单R1–R12,本轮剩余为R4/R6/R8/R9,不扩展新组件或SSR要求。本轮只增加回归与复核记录,未修改实现、未合并。
## 已完成及证据
- 上一份13项整批探针全部通过;真实组件$props正例和类型检查通过。
- 浏览器5181重验分组长菜单:已Portal脱离preview,面板z-index=100000,top=12px、height=406.98px,可用高度约束生效,transform-origin=128px 406.98px;顶部内容可命中,不再被前一代码区或导航遮挡。证据截图 `/private/tmp/b01-layering-fixed-review.png`。
- Portal后的Modal组合:子菜单Esc→只剩根菜单,焦点回子触发器;再Esc→Modal保留,焦点回模态内触发器;再Esc→Modal关闭,body overflow/pointer-events均恢复空值,焦点回“打开组合复核”。临时源夹具已从docs移除。
- 分组禁用与作用域、typed key DOM id、链接元素、Surface重置、包装组件类型等原探针均通过。
## 剩余4类 / 7项失败(本轮完整清单)
### R4:关闭策略仍有3条错误
1. **[P1] 默认动作项执行后不关闭。** `Menu.vue:153` 把默认shouldCloseOnSelect算成 `selectionMode === 'multiple'`。none动作模式得到false,导致默认示例“新建文件”点击后仍展开。浏览器实测根trigger aria-expanded=true、menu仍在;新增回归也失败。
2. **[P1] single菜单的shouldCloseOnSelect=false被忽略。** Item.shouldClose只处理函数策略,选择模式直接按single返回true。
3. **[P1] multiple菜单的shouldCloseOnSelect=true被忽略。** 同一逻辑直接返回false。
明确统一优先级:条目显式策略→菜单显式布尔/函数策略→按实际条目模式的默认策略(动作和单选关闭,多选保持)。不要把未设置的策略提前变成错误布尔。Section级模式也要遵循该优先级。保留原条目closeOnSelect两个已通过回归。
### R6:根Popover覆盖用户原生事件(1项)
**[P2] DropdownPopover onKeydown完全不调用。** Root面板`...attrs`之后直接写onKeydown:onSurfaceKeydown,覆盖用户处理器。对非Escape的a键也不调用(新回归失败)。同位置的onOpenAutoFocus/onEscapeKeyDown/onInteractOutside/onAnimationend存在相同覆盖写法;按原R6要求统一合并并尊重取消,不只特判这一个a键。用户回调先执行,内部逻辑检查defaultPrevented,Vue处理器数组语义保留。
### R9:子菜单面板参数丢失(2项)
1. **[P2] 嵌套Popover的data/style/id/其他事件仍丢失。** inheritedProps虽采集了这些项,渲染SubContent只spread手工构造的panelProps,未将它们应用;data-custom和style探针失败。仅class与keydown修通不能标整个R9完成。
2. **[P1] 子面板isKeyboardDismissDisabled=true仍被Esc关闭。** 参数虽在PANEL_PROPS清单里,却没用于子层handleEscape或底层dismiss守卫(新回归失败)。shouldCloseOnInteractOutside同样被采集但未调用;应统一补齐原R9公开参数的真实归属及取消链路。阻止当前层Esc时不能再误关父层/Modal。
已明确记录为底层限制的子菜单side/align、delay不在本轮重新扩大要求;本轮要求兑现的是已宣称支持的参数和原清单中的属性透传。
### R8:独立Menu仍丢失可访问名称(1项)
**[P2] Menu aria-label不在真实role=menu上。** 独立路径没有menuContentAttrsKey上游提供者,contentAttrs=null;listProps又把aria-label/labelledby/describedby删掉,最终真正Content也只有undefined。`Menu aria-label='Standalone actions'`回归失败。为独立容器和Dropdown容器分别处理真实语义节点的名称/描述,不重新制造双menu角色。保留已修正的静态布局及无滚动锁行为。
## 本轮命令结果
- 扩充 `tests/b01-complete-review.probe.test.ts`:20项,原13项通过,新7项失败;断言覆盖以上全部失败路径。
- `pnpm test`:72文件,71通过/1失败;924项,917通过/7失败,全部失败位于本次扩充的整批回归文件。
- `pnpm typecheck`通过(包含真实包装组件Props消费正例);`git diff --check`通过。
- 不新增SSR/水合/Nuxt验收,不把未重做的完整读屏/触屏/逐像素当作通过。
修复后按原整批清单复验受影响的默认/显式关闭策略、根/子事件及参数、独立Menu名称,并保持层级/Portal/Modal已通过路径。继续当前任务分支,交回复核,不合main、不推送。
## b474a63 后续复核
原7项已修复通过。当前仅原R9子面板ARIA/事件/loop分支及测试环境异常未完成,详见 [B01-b474a63-review.md](./B01-b474a63-review.md)。三级中间焦点未固化自动断言不作为新增门槛。