Skip to content

[all components] Sync hover open event state - #4526

Merged
atomiks merged 11 commits into
mui:masterfrom
atomiks:codex/popover-hover-reopen-during-close
Apr 6, 2026
Merged

atomiks merged 11 commits into
mui:masterfrom
atomiks:codex/popover-hover-reopen-during-close

Conversation

@atomiks

@atomiks atomiks commented Apr 6, 2026 •

Copy link
Copy Markdown
Contributor

This fixes stale hover logic so click-like interactions do not block later hover reopen behavior.

Changes

  • Fix hover reopen during a hover close transition, including same-trigger re-entry.
  • Move shared root-side open-change work into FloatingRootStore.
  • Reuse that shared logic from Menu, Popover, Dialog, Tooltip, and Preview Card.
  • Simplify the synced-root mode by replacing the old flag with a smaller syncOnly path.
  • Add regressions for menu, popover, and dialog around the affected flows.

@atomiks atomiks added type: bug It doesn't behave as expected. component: popover Changes related to the popover component. labels Apr 6, 2026 — with ChatGPT Codex Connector
@pkg-pr-new

pkg-pr-new Bot commented Apr 6, 2026 •

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

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

commit: 69d7605

@mui-bot

mui-bot commented Apr 6, 2026 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react ▼-24B(-0.01%) ▼-52B(-0.04%)

Details of bundle changes


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

@netlify

netlify Bot commented Apr 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 69d7605
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69d3b9d939a2a3000811050d
😎 Deploy Preview https://deploy-preview-4526--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.

@atomiks
atomiks marked this pull request as ready for review April 6, 2026 03:23
@atomiks atomiks changed the title [popover] Fix hover reopen during close transition [all components] Sync hover open event state Apr 6, 2026

atomiks commented Apr 6, 2026

Copy link
Copy Markdown
Contributor Author

Codex Review (GPT-5.4)

Reviewed the full updated branch against a freshly fetched upstream/master. Dominant type: bug-fix with tests and react-ui secondary scope; the root-owned openchange bookkeeping now looks behaviorally consistent across the touched synced-root consumers, and the remaining coverage gap I previously called out has been closed.

1. Bugs / Issues (None)

Root Cause & Patch Assessment

The core fix still looks sound on the updated branch. Moving openEvent syncing and internal openchange emission behind dispatchOpenChange(...) fixes the old synced-root ordering problem while keeping cancellation store-owned, and the useHoverReferenceInteraction change correctly lets the close-transition fast path run before the rest-only early return.

Pattern Consistency Assessment

The touched consumers remain aligned after the refactor. Menu, Popover, Dialog, Tooltip, and Preview Card all route root-side side effects through the same dispatchOpenChange(...) path, and I did not find a touched component still carrying divergent openchange or openEvent bookkeeping.

Test Coverage Assessment

The branch now has proportional regression coverage for the shared bookkeeping change. In addition to the existing Menu, Popover, and Dialog regressions, the latest update adds targeted reopen coverage for Tooltip and Preview Card, which closes the main branch-wide risk I had left open.

I also re-ran the affected jsdom suites on the updated branch:
pnpm test:jsdom MenuRoot --no-watch
pnpm test:jsdom PopoverRoot --no-watch
pnpm test:jsdom DialogRoot --no-watch
pnpm test:jsdom TooltipRoot --no-watch
pnpm test:jsdom PreviewCardRoot --no-watch

Recommendation

Approve ✅

I do not see any remaining actionable issues in the implementation or its updated regression coverage. The bookkeeping ownership is cleaner than before, the touched components are consistent with each other, and the added tests cover the previously under-validated consumers.

@atomiks
atomiks merged commit eb21aba into mui:master Apr 6, 2026
7 checks passed
@atomiks
atomiks deleted the codex/popover-hover-reopen-during-close branch April 6, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants