fix(dropdown): keep dropdown trigger positional inside ButtonGroup
Review of the restored button-group demos found the merged pull-request group's seam broken: DropdownRoot renders a .hv-dropdown wrapper (a recorded Vue adaptation) so the trigger button stopped being a positional child of .button-group and matched :first-child:last-child, taking a full 24px radius against the merge button's 24/0 end cap. The internal __button_group_child marker also leaked onto the DOM. Upstream Dropdown has no DOM root (RAC MenuTrigger renders a bare SlotProvider and drops root props), so the trigger naturally occupies the group's :last-child slot and the shared seam rules apply unchanged. - DropdownRoot absorbs the ButtonGroup direct-child marker and skips the wrapper when marked, restoring positional seam radii and outline seam borders without touching the styles package (kept line-parity with the pinned source) - wrapper contract (data-slot=dropdown-root, data-trigger, root class host) unchanged outside ButtonGroup; documented in dropdown.md - regression tests: positional trigger + no marker leak in groups, wrapper still hosts root class standalone
This commit is contained in:
@@ -410,7 +410,7 @@ Dropdown 组件实现 ARIA 菜单模式,并提供:
|
||||
- 官方 `items` + 渲染函数的数据驱动集合用 `v-for` 表达;`renderEmptyState` 对应 `empty` 插槽。不提供 React Collection 对象模型。
|
||||
- 子菜单悬停展开延迟由底层固定为 100ms,未暴露官方 `delay`(默认 200ms);子菜单面板的 `side`/`align` 由底层固定,只有偏移与碰撞参数可调。
|
||||
- `DropdownTrigger` 的作用域插槽只提供 `{ isOpen }`,`DropdownPopover` 只提供 `{ isEntering, isExiting, placement }`;官方 Button/Popover 的完整 render props 未全部覆盖。
|
||||
- `DropdownRoot` 额外渲染一层 `.hv-dropdown` 包裹元素(官方该类没有 DOM 宿主),用于承载根级 class 与方向。
|
||||
- `DropdownRoot` 额外渲染一层 `.hv-dropdown` 包裹元素(官方该类没有 DOM 宿主),用于承载根级 class 与方向。作为 `ButtonGroup` 直接子级时省略该包裹元素,让触发按钮保持组内的位置接缝;该场景下根级 attrs 与官方一致不落 DOM。
|
||||
- 条目 `id` 是业务 key,DOM id 为实例级;官方把 key 直接作为 DOM id(Vue 端避免数字 `0` 与字符串 `"0"` 冲突)。
|
||||
- 条目 `onClick` 中 `preventDefault()` 会取消动作、选择与关闭;`stopImmediatePropagation()` 会终止后续处理器,均为原生事件语义。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user