[navigation menu] Click after a hover switch closes the item
Bug report
Current behavior
With one navigation menu item already open, moving the pointer onto another trigger switches the open item, and the click that follows closes it. Opening the item under the pointer takes a second click.
handleActivation calls setValue directly on mouseenter when value != null, and it clears openEvent. That path never enters handleOpenChange, which is the only place that arms stickIfOpen. The click then runs useClick with toggle: true (the trigger is now the active item) and no openEvent, so getNextOpen returns false and the item closes.
The same handleActivation path is in v1.8.0, v1.9.0, and current master.
Expected behavior
The click that lands on the trigger the pointer just switched to leaves that item open. useClick's stickIfOpen already does this when the open was recorded through onOpenChange. A later press on that same trigger still closes it.
Reproducible example
Two triggers, default hover behavior:
- Click the first trigger. Its popup opens.
- Move the pointer onto the second trigger. The popup switches.
- Click the second trigger.
The second trigger's popup closes instead of staying open.
Base UI version
v1.8.0 and v1.9.0. Also present on master (handleActivation still calls setValue and clears openEvent on non-click activation while a value is set).
Which browser are you using?
Chrome
Which OS are you using?
Linux
Which assistive tech are you using (if applicable)?
N/A
Additional context
stickIfOpen in useClick keeps a hover-opened popup open when openEvent is not a click. Navigation menu hover-switch never records that event because activation bypasses onOpenChange:
https://github.com/mui/base-ui/blob/v1.9.0/packages/react/src/navigation-menu/trigger/NavigationMenuTrigger.tsx#L565-L592
I think this might be expected behavior rather than a bug, depending on the intended UX.
The reported interaction is:
- Click A → opens the menu.
- Hover B → switches the active content.
- Click B → closes the menu.
From a UX perspective, this seems reasonable: hover switches between items, while clicking the active trigger toggles the menu.
ROI review · current PR reassessment
PR assessed: #6113.
🟠 Defer — merging PR #6113 is not recommended yet.
medium confidence — The interaction is ordinary and the patch small, but whether clicking a just-hovered active trigger should close remains unresolved.
Existing-API assessment: Second click works; controlled cancellation untested.
| Consideration | Assessment |
|---|---|
| Design foundation | suitable: The existing owner is suitable if maintainers choose patient-click semantics for switches; intended behavior remains unresolved. |
| Realistic user/app flow | established: Ordinary adjacent-trigger movement and quick click. |
| Benefit / reach | Neighboring category can close on click; independent reach unknown. |
| Severity / workaround | Recoverable pointer failure; another click reopens it. Second click works; controlled cancellation untested. |
| Cost / risk | Measured diff: 73 changed lines; 0 added dependencies; bundle delta: unmeasured. No dependencies; byte delta unknown. Reuses current state and timer; production +20/−7 lines. Changes fast-click semantics; later-close tests retained. |
| Alternatives / next step | Choose patient-click switching or intentional immediate toggling. Maintainer confirms whether hover switches should inherit the 500ms patient-click policy. |
Affected too? Add a 👍 reaction and tell us how this affects your app. Feedback is welcome. This review can change.
🤖 Comment posted by Codex