Skip to content

[navigation menu] Fix nested popup dismiss actions - #2978

Merged
atomiks merged 6 commits into
mui:masterfrom
atomiks:fix/useDismiss-remove-timeout
Oct 26, 2025
Merged

atomiks merged 6 commits into
mui:masterfrom
atomiks:fix/useDismiss-remove-timeout

Conversation

@atomiks

@atomiks atomiks commented Oct 14, 2025 •

Copy link
Copy Markdown
Contributor

Fixes #2390

Preview (taken from issue): https://deploy-preview-2978--base-ui.netlify.app/experiments/navigation-menu-popups

A few issues fixed here because of portals:

  • NavigationMenu.List needs to receive the useDismiss floating props so the markInsideReactTree function works for the nested portaled popups. Because the content is moved into the popup, the portal event bubbling doesn't work like it does the other popups.
  • Hovering a trigger, then opening a portaled popup inside the trigger's own popup, then hovering into the child popup, caused the parent to close once it left the parent's bounding box
  • Fixes conflicting dismiss events (pointerdown vs pointerup) by requiring the outside press to be intentional (since it's a complex popup, this matches Dialog/Popover too)

@atomiks atomiks added type: bug It doesn't behave as expected. component: navigation menu Changes related to the navigation menu component. labels Oct 14, 2025
@pkg-pr-new

pkg-pr-new Bot commented Oct 14, 2025 •

Copy link
Copy Markdown

vite-css-base-ui-example

pnpm add https://pkg.pr.new/mui/base-ui/@base-ui-components/react@2978
pnpm add https://pkg.pr.new/mui/base-ui/@base-ui-components/utils@2978

commit: 54fd111

@netlify

netlify Bot commented Oct 14, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 54fd111
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/68fe9f50a755e20008823ba3
😎 Deploy Preview https://deploy-preview-2978--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@mui-bot

mui-bot commented Oct 14, 2025 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui-components/react 🔺+749B(+0.20%) 🔺+241B(+0.20%)

Details of bundle changes

@atomiks
atomiks force-pushed the fix/useDismiss-remove-timeout branch from d477f8b to f16831b Compare October 16, 2025 23:10
@atomiks
atomiks force-pushed the fix/useDismiss-remove-timeout branch 5 times, most recently from 934aa0a to 92cf4cf Compare October 17, 2025 00:12
@atomiks
atomiks force-pushed the fix/useDismiss-remove-timeout branch from 92cf4cf to 1cfc003 Compare October 17, 2025 00:13
@atomiks
atomiks marked this pull request as ready for review October 17, 2025 00:19
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 21, 2025
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 22, 2025

@mnajdova mnajdova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The logic and the example work as expected. I would recommend adding test, so we don't accidently break the behavior later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: navigation menu Changes related to the navigation menu component. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dialog][navigation menu] Nesting Dialogs in Navigation Menu creates conflicting dismiss actions

3 participants