Skip to content

[popup] Fix controlled hover leave close#4893

Draft
atomiks wants to merge 1 commit into
mui:masterfrom
atomiks:codex/fix-controlled-hover-leave
Draft

[popup] Fix controlled hover leave close#4893
atomiks wants to merge 1 commit into
mui:masterfrom
atomiks:codex/fix-controlled-hover-leave

Conversation

@atomiks
Copy link
Copy Markdown
Contributor

@atomiks atomiks commented May 22, 2026

Fixes #4815 (review)

Controlled popups that were opened externally could close when the pointer left the floating element. This keeps hover leave from closing only when the controlled open did not come from one of the popup's own open interactions.

Root cause

The hover interaction only knew about click-like trigger events, so externally controlled opens still looked hover-closeable once the pointer left the floating element.

Changes

  • Track whether a popup is controlled in the floating root context.
  • Skip hover-leave close handling only for externally controlled opens without an open event.
  • Cover Menu, Popover, and PreviewCard controlled external opens and trigger-driven controlled opens.

@atomiks atomiks added type: bug It doesn't behave as expected. component: menu Changes related to the menu component. component: popover Changes related to the popover component. component: preview card Changes related to the preview card component. labels May 22, 2026 — with ChatGPT Codex Connector
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 22, 2026

commit: 3e17c5d

@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented May 22, 2026

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+133B(+0.03%) 🔺+40B(+0.03%)

Details of bundle changes

Performance

Total duration: 1,097.61 ms -151.41 ms(-12.1%) | Renders: 50 (+0) | Paint: 1,672.50 ms -222.89 ms(-11.8%)

Test Duration Renders
Slider mount (300 instances) 148.83 ms ▼-52.94 ms(-26.2%) 3 (+0)
Dialog mount (300 instances) 45.46 ms ▼-15.99 ms(-26.0%) 1 (+0)
Tooltip mount (300 contained roots) 43.23 ms ▼-12.36 ms(-22.2%) 1 (+0)

9 tests within noise — details


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

@netlify
Copy link
Copy Markdown

netlify Bot commented May 22, 2026

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 3e17c5d
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a104fc9fe45d00008cc8e4d
😎 Deploy Preview https://deploy-preview-4893--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.

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. component: popover Changes related to the popover component. component: preview card Changes related to the preview card component. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant