Skip to content

Commit c2b7baa

Browse files
committed
fix: unit test for Menu
1 parent fc128e7 commit c2b7baa

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,9 @@ Complex components compose these headless building blocks — good entry points
268268
- `collection``RdxCollectionProvider` + `RdxCollectionItem`: collects item directives in **DOM order** via `contentChildren` (matches `hostDirectives` too). Read items off the instance (`item.element`, `item.value()`, `item.disabled()`); `useCollection()` = `inject(RdxCollectionProvider)`. Only consumer: `select`.
269269
- `portal``RdxPortal`: teleports its host element into a container (default `document.body`), reactively; non-element containers fall back to body.
270270
- `presence` — conditional mount/unmount with enter/leave animation support.
271-
- `roving-focus`, `focus-scope`, `dismissable-layer`, `popper` — focus roving, focus trapping, outside-dismiss, positioning.
271+
- `roving-focus`, `focus-scope`, `popper` — focus roving, focus trapping, positioning.
272+
- `dismissable-layer` — outside-dismiss (Escape / pointer-down-outside / focus-outside). **Gotcha:** the focus-outside check is **async** (defers two microtasks before deciding), so an element that takes focus _outside_ a layer and then opens it can be dismissed a tick later. Register such elements as **branches** (`rdxDismissableLayerBranch`, or push the element into `RdxDismissableLayersContextToken.branches`) so focus/pointer on them counts as "inside" and won't dismiss. Example: a menu trigger the menubar focuses before opening a sibling popup.
273+
- `menu` / `menubar` — Menubar is a **coordinator over `rdxMenuRoot` + the standard `rdxMenuTrigger`** (no dedicated menubar-trigger directive, mirroring Base UI). The trigger reports interactions up via `registerTriggerInteractionHandler`; the menubar owns roving focus, arrow-key nav, and hover-to-switch.
272274

273275
## Useful commands
274276

packages/primitives/menu/__tests__/menu.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,6 @@ describe('Menu', () => {
540540
trigger = fixture.nativeElement.querySelector('[rdxMenuTrigger]');
541541
trigger.click();
542542
fixture.detectChanges();
543-
popup = fixture.nativeElement.querySelector('[rdxMenuPopup]');
544543
items = Array.from(fixture.nativeElement.querySelectorAll('[rdxMenuItem]'));
545544
});
546545

0 commit comments

Comments
 (0)