Skip to content

[test] Fix focus return after Escape hover leave - #4906

Merged
atomiks merged 1 commit into
mui:masterfrom
atomiks:codex/menu-escape-hover-focus
May 26, 2026
Merged

atomiks merged 1 commit into
mui:masterfrom
atomiks:codex/menu-escape-hover-focus

Conversation

@atomiks

@atomiks atomiks commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #4898

This PR is now test-only coverage for the Escape focus-return regression. The underlying click-opened menu behavior was fixed by #4893 (94a9d1e6a), which added the hover-open guard in useHoverFloatingInteraction.

The new Chromium regression:

It keeps coverage for the case where a menu is closed with Escape while its popup remains mounted for an exit transition, then the positioner receives a late mouseleave because pointer-events change under the resting pointer.

Changes

  • Add a Chromium-only Menu regression asserting focus returns to the trigger after Escape plus a late closing-menu mouseleave.

@atomiks atomiks added component: menu Changes related to the menu component. type: bug It doesn't behave as expected. type: regression A bug, but worse, it used to behave as expected. labels May 25, 2026 — with ChatGPT Codex Connector
@pkg-pr-new

pkg-pr-new Bot commented May 25, 2026 •

Copy link
Copy Markdown

commit: e913f7c

@code-infra-dashboard

code-infra-dashboard Bot commented May 25, 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,098.47 ms -201.49 ms(-15.5%) | Renders: 50 (+0) | Paint: 1,663.33 ms -290.69 ms(-14.9%)

Test Duration Renders
Slider mount (300 instances) 142.81 ms ▼-56.02 ms(-28.2%) 3 (+0)
Menu open (500 items) 68.03 ms ▼-25.74 ms(-27.4%) 12 (+0)
Checkbox mount (500 instances) 61.33 ms ▼-23.28 ms(-27.5%) 1 (+0)

9 tests within noise — details


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

@netlify

netlify Bot commented May 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

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

@atomiks
atomiks force-pushed the codex/menu-escape-hover-focus branch from e841e27 to e913f7c Compare May 26, 2026 10:38
@atomiks atomiks changed the title [menu] Fix focus return after Escape hover leave [menu] Add Escape hover focus regression test May 26, 2026
@atomiks atomiks added test and removed component: menu Changes related to the menu component. type: bug It doesn't behave as expected. type: regression A bug, but worse, it used to behave as expected. labels May 26, 2026
@atomiks atomiks changed the title [menu] Add Escape hover focus regression test [test] Fix focus return after Escape hover leave May 26, 2026
@atomiks
atomiks marked this pull request as ready for review May 26, 2026 11:04
@atomiks
atomiks merged commit 2aa1f56 into mui:master May 26, 2026
23 checks passed
@atomiks
atomiks deleted the codex/menu-escape-hover-focus branch May 26, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[menu] Focus is lost after closing via ESC

1 participant