Skip to content

components/Menu: Restore Modal focus return when menu items close (#81164) - #81446

Merged
t-hamano merged 1 commit into
wp/7.1from
codex/issue-80734-menu-focus-handoff-7.1
Aug 12, 2026
Merged

components/Menu: Restore Modal focus return when menu items close (#81164)#81446
t-hamano merged 1 commit into
wp/7.1from
codex/issue-80734-menu-focus-handoff-7.1

Conversation

@t-hamano

@t-hamano t-hamano commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What?

Backports #81164 to the wp/7.1 branch.

Why?

The cherry-pick did not apply cleanly, so it needs a dedicated PR rather than an automated backport.

How?

Cherry-picked 13a0338a03a and resolved the conflicts. Only the following three files conflicted, and none of the component logic changed:

  • packages/components/CHANGELOG.md
  • packages/components/src/menu/stories/index.story.tsx
  • tools/eslint/suppressions.json

Testing Instructions

  1. Open Components / Actions / Menu / With Modal in Storybook with Global CSS: Font only.
  2. Open the menu and select Open modal.
  3. Confirm that the menu closes and scrolling stays locked.
  4. Close the Modal.
  5. Confirm that scrolling is restored and focus returns to Open menu.

Testing Instructions for Keyboard

Repeat using Enter to select Open modal.

Use of AI Tools

Claude Code was used to resolve the cherry-pick conflicts and draft this description. The resulting diff was reviewed locally.

@github-actions github-actions Bot added the [Package] Components /packages/components label Aug 11, 2026
@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). labels Aug 11, 2026
@github-actions

Copy link
Copy Markdown

Size Change: +280 B (0%)

Total Size: 7.75 MB

📦 View Changed
Filename Size Change
build/scripts/components/index.min.js 272 kB +238 B (+0.09%)
build/styles/components/style-rtl.css 18.1 kB +11 B (+0.06%)
build/styles/components/style-rtl.min.css 15 kB +11 B (+0.07%)
build/styles/components/style.css 18.2 kB +10 B (+0.06%)
build/styles/components/style.min.css 15 kB +10 B (+0.07%)

compressed-size-action

…1164)

* Menu: Restore focus handoff when items close

* Menu: Preserve default modal dismissal coverage

* Menu: Preserve hideOnClick behavior during focus handoff

* Menu: Add focus handoff changelog

* Menu: Cover closing and keep-open Modal stories

* Menu: Simplify Modal regression coverage

* Modal: Add default scroll lock styles

* Menu: Follow current import conventions

---

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: yashjawale <yashjawale@git.wordpress.org>
@t-hamano
t-hamano force-pushed the codex/issue-80734-menu-focus-handoff-7.1 branch from 38d58f8 to 23bb737 Compare August 11, 2026 16:55
@t-hamano t-hamano self-assigned this Aug 11, 2026
@github-actions

Copy link
Copy Markdown

Flaky tests detected in 23bb737.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/31514981676
📝 Reported tests:

two users concurrently move list items (RTC WebSocket) in /test/e2e/specs/editor/collaboration/collaboration-stress.spec.ts, passed after 1 failed attempt.
Error: expect(received).toBeLessThan(expected)

Expected: < 3
Received:   4

Call Log:
- Timeout 10000ms exceeded while waiting on the predicate
    at assertMovedOrder (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-stress.spec.ts:657:8)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-stress.spec.ts:661:10

@t-hamano
t-hamano marked this pull request as ready for review August 12, 2026 02:34
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano

Copy link
Copy Markdown
Contributor Author

I performed smoke tests using Windows NVDA, and it is working well.

@t-hamano
t-hamano merged commit 7e91469 into wp/7.1 Aug 12, 2026
45 checks passed
@t-hamano
t-hamano deleted the codex/issue-80734-menu-focus-handoff-7.1 branch August 12, 2026 03:00
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Aug 12, 2026
This updates the pinned commit hash of the Gutenberg repository from `ea285b45692aed6c4f95353671393402f97f0aa7` to `b9743a015526ac8fd79298fd4e96cf002cee333b`.

A full list of changes included in this commit can be found on GitHub: 
WordPress/gutenberg@ea285b4...b9743a0

- Style states: fix state deselection when selecting the already selected block (WordPress/gutenberg#81277)
- Global styles: render element styles set only inside a breakpoint (WordPress/gutenberg#81265)
- Style states: Fix phantom pseudo element style output (WordPress/gutenberg#81291)
- Docs: remove breakpoint-only element style example from global styles guide (WordPress/gutenberg#81308)
- theme.json schema: responsive states belong to blocks (WordPress/gutenberg#81253)
- theme.json schema: allow responsive states on block style variations (WordPress/gutenberg#81309)
- Render viewport state element styles in the editor (WordPress/gutenberg#81307) (WordPress/gutenberg#81311)
- Site Editor: Decode HTML entities in Identity fields (WordPress/gutenberg#81269) (WordPress/gutenberg#81320)
- Editor: Keep the canvas height stable while resizing the canvas (WordPress/gutenberg#81374)
- Playlist: Normalize Waveform Player configuration handling (WordPress/gutenberg#81375)
- Playlist: Improve audio conversion and track selection (WordPress/gutenberg#80926) (WordPress/gutenberg#81385)
- fix: order site identity changes predictably (WordPress/gutenberg#81283)
- Cover: Avoid passing null as the featured image size (WordPress/gutenberg#81444)
- components/Menu: Restore Modal focus return when menu items close (WordPress/gutenberg#81446)
- Notes: Fix text wrapping for long usernames in collaboration sidebar (WordPress/gutenberg#81406)
- Site Editor: Use inverted ThemeProvider seed for portaled UI (WordPress/gutenberg#81296)

Props wildworks.
See #65529.

git-svn-id: https://develop.svn.wordpress.org/branches/7.1@63209 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Aug 12, 2026
This updates the pinned commit hash of the Gutenberg repository from `ea285b45692aed6c4f95353671393402f97f0aa7` to `b9743a015526ac8fd79298fd4e96cf002cee333b`.

A full list of changes included in this commit can be found on GitHub: 
WordPress/gutenberg@ea285b4...b9743a0

- Style states: fix state deselection when selecting the already selected block (WordPress/gutenberg#81277)
- Global styles: render element styles set only inside a breakpoint (WordPress/gutenberg#81265)
- Style states: Fix phantom pseudo element style output (WordPress/gutenberg#81291)
- Docs: remove breakpoint-only element style example from global styles guide (WordPress/gutenberg#81308)
- theme.json schema: responsive states belong to blocks (WordPress/gutenberg#81253)
- theme.json schema: allow responsive states on block style variations (WordPress/gutenberg#81309)
- Render viewport state element styles in the editor (WordPress/gutenberg#81307) (WordPress/gutenberg#81311)
- Site Editor: Decode HTML entities in Identity fields (WordPress/gutenberg#81269) (WordPress/gutenberg#81320)
- Editor: Keep the canvas height stable while resizing the canvas (WordPress/gutenberg#81374)
- Playlist: Normalize Waveform Player configuration handling (WordPress/gutenberg#81375)
- Playlist: Improve audio conversion and track selection (WordPress/gutenberg#80926) (WordPress/gutenberg#81385)
- fix: order site identity changes predictably (WordPress/gutenberg#81283)
- Cover: Avoid passing null as the featured image size (WordPress/gutenberg#81444)
- components/Menu: Restore Modal focus return when menu items close (WordPress/gutenberg#81446)
- Notes: Fix text wrapping for long usernames in collaboration sidebar (WordPress/gutenberg#81406)
- Site Editor: Use inverted ThemeProvider seed for portaled UI (WordPress/gutenberg#81296)

Props wildworks.
See #65529.
Built from https://develop.svn.wordpress.org/branches/7.1@63209


git-svn-id: http://core.svn.wordpress.org/branches/7.1@62402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Sponsor
SponsoredKunjungi sekarang
Promo