Repository navigation
[menu] Fix nested menus without a root trigger - #5645
Merged
Merged
Conversation
LukasTy
requested review from
atomiks,
colmtuite,
flaviendelangle,
jjenzz and
michaldudak
as code owners
September 8, 2026 14:25
commit: |
Bundle size
PerformanceTotal duration: 1,240.94 ms +177.87 ms(+16.7%) | Renders: 76 (+0) | Paint: 1,997.02 ms +284.13 ms(+16.6%)
10 tests within noise — details Metric alarms
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
mariomile
added a commit
to mariomile/Kore
that referenced
this pull request
Sep 16, 2026
* fix: keep the block menu open when hovering Turn into Base UI 1.7.0 never registers a floating node id for a root menu that has no Menu.Trigger, so the block-handle menu (opened on a virtual anchor) treated its own Turn into submenu as a sibling and closed itself with reason sibling-open. Backport mui/base-ui#5645 as a pnpm patch until a release ships it, and cover the gesture with a browser test. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix: never reveal the source of a rendered collection fence The fence source appeared above the Collection widget whenever the caret entered the code block. Hide the source for rendered fences and keep the caret out of them: an appendTransaction guard jumps the selection past the fence in its direction of travel, selecting the block when there is no text on that side. Co-Authored-By: Claude Fable 5.1 <[email protected]> --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a root menu has no
Menu.Trigger, opening its first submenu closes the root with reasonsibling-open. The root has no floating node ID, so the submenu has no parent ID and appears to be a sibling. This affects menus opened through a controlled external anchor, including the integration in mui/material-ui#48823.Let the root supply its tree IDs when there is no active trigger. Read the store in the layout effect because a trigger can register after render and before that effect. Subscribe to the active trigger element so the effect also responds to trigger changes.
Add 11 Base UI tests for root survival, Escape and focus return, LTR and RTL, kept-mounted roots, external anchors, reopening, item selection, sibling closing on click and hover, initially open submenus, and real trigger registration. The registration tests check the IDs in the same layout pass.
Validation:
master; all 11 pass with the fix in Chromium and jsdom.pnpm valelintreports one existing error inCONTRIBUTING.md:169: usejsdominstead ofJSDOM. This PR does not change that file.Related: #5344 was closed and proposed an event filter. This change supplies the missing IDs instead. #5641 concerns shared trigger ownership and does not change this menu ID path.