fix: resolve close policy, handler merging and submenu panel props
- Menu forwards the raw close policy and the item resolves item > menu (boolean or function) > per-mode default, so action items close by default and an explicit single/multiple policy is no longer pre-empted. - Root popover chains caller handlers with the internal ones for keydown, escape, interact-outside, auto focus and animation end; callers run first and a prevented event stops the internal logic. - Submenu panels receive the nested popover's data/style/id/extra events, honour isKeyboardDismissDisabled without closing the parent level or a modal, and forward shouldCloseOnInteractOutside. - A standalone Menu provides its own content-attribute channel so the accessible name/description land on the real role=menu node.
This commit is contained in:
@@ -961,3 +961,13 @@ Button/PopoverTrigger/Link/ToggleButtonGroup 源码及几何复核后,移除
|
||||
- **能力清单**:`disallowEmptySelection`、`escapeKeyBehavior`、`shouldFocusWrap`、`autoFocus`、菜单级 `shouldCloseOnSelect`、`close` 事件、`empty` 插槽、`isKeyboardDismissDisabled`、`shouldCloseOnInteractOutside`、`placement/offset/crossOffset/shouldFlip/containerPadding`、Trigger/Popover 作用域插槽已提供;`items` 以 `v-for`、`renderEmptyState` 以 `empty` 插槽表达,子菜单 `delay` 与 `side/align` 作为底座固定值记录在页面「上游差异」。
|
||||
- **独立浏览器消费**:`tests/package/b01-consumer-app/` 夹具用 tarball 安装后 esbuild 打包、静态服务,实测分组级多选、三级子菜单、链接项、Modal 内菜单(Esc 先关菜单再关 Modal,body 样式清空、焦点回触发器)与独立 Menu。控制台仅有 Vue feature flag 提示,无组件告警或错误。
|
||||
- 回归:**72 文件 / 917 项**通过;typecheck、build:docs、Prettier 通过。仍未验证:完整读屏、物理触屏、逐像素对比、Nuxt/SSR(本批不要求)。
|
||||
|
||||
### B01 整批清单二次返修(同日)
|
||||
|
||||
按 [整批清单返修复核](migrations/B01-complete-review-2.md) 处理剩余 R4/R6/R8/R9 共 7 项;`tests/b01-complete-review.probe.test.ts` 由 13 扩到 **20/20** 全通过。
|
||||
|
||||
- **R4 关闭策略**:`Menu` 只转发菜单级原始策略,`MenuItem` 按「条目显式 → 菜单显式布尔/函数 → 按条目模式默认(动作/单选关闭、多选保持)」解析。默认动作项实测点击后关闭(浏览器 `aria-expanded=false`、菜单消失);single+`false` 与 multiple+`true` 两项通过;Section 级模式同样遵循该优先级。
|
||||
- **R6 根面板事件合并**:`onKeydown`/`onEscapeKeyDown`/`onInteractOutside`/`onOpenAutoFocus`/`onAnimationend` 改为「调用方处理器 + 内部处理器」的数组链,调用方先执行,`defaultPrevented` 后内部不再动作。新增回归覆盖四类事件各调用一次、以及调用方取消 Escape 后 `clearSelection` 不再执行。
|
||||
- **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。
|
||||
|
||||
Reference in New Issue
Block a user