Skip to content

[menu] Add regression test for rendered trigger id submenu close - #5212

Merged
atomiks merged 2 commits into
mui:masterfrom
atomiks:claude/base-ui-5170-workaround-5ccb2c
Jul 14, 2026
Merged

atomiks merged 2 commits into
mui:masterfrom
atomiks:claude/base-ui-5170-workaround-5ccb2c

Conversation

@atomiks

@atomiks atomiks commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Part of #5170

This adds regression coverage for the deterministic custom-render-ID manifestation reported in #5170 (comment). It does not reproduce the original no-id snippet from the issue body.

A trigger whose id comes from the render element (render={<button id="custom-trigger" />}) used to leave the menu store without an active trigger, so floatingNodeId was never forwarded and opening a submenu closed the whole root menu with reason: "sibling-open". #5110 had already fixed the underlying ID reassociation across popup components, but its component-level regression coverage was limited to Tooltip.

This adds a Menu regression test covering the full chain through the MenuPositioner sibling-open check, in both the contained and detached trigger variants. Verified red with #5110 reverted (both variants close the entire tree) and green on master.

@atomiks atomiks added component: menu Changes related to the menu component. test labels Jul 13, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

commit: 50016aa

@code-infra-dashboard

code-infra-dashboard Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 0B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

Total duration: 1,274.86 ms +65.51 ms(+5.4%) | Renders: 78 (+0) | Paint: 1,975.82 ms +97.07 ms(+5.2%)

Test Duration Renders
Checkbox mount (500 instances) 74.44 ms 🔺+15.17 ms(+25.6%) 1 (+0)

13 tests within noise — details

Metric alarms

Test Metric Change
Checkbox mount (500 instances) bench:paint 🔺 +26.07 ms

Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 50016aa
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a55c3aa48fbaa00086174f8
😎 Deploy Preview https://deploy-preview-5212--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a targeted regression test to ensure a root Menu does not close with reason: "sibling-open" when opening a submenu in the specific case where the root trigger’s DOM id originates from the render element (custom id), covering both contained and detached trigger setups.

Changes:

  • Add a regression test that opens a root menu, opens a submenu via click, and asserts the root menu remains mounted.
  • Assert the root onOpenChange is not invoked with reason: REASONS.siblingOpen for this scenario.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@atomiks
atomiks merged commit ddb031c into mui:master Jul 14, 2026
24 checks passed
@atomiks
atomiks deleted the claude/base-ui-5170-workaround-5ccb2c branch July 14, 2026 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: menu Changes related to the menu component. test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants