Skip to content

Improve focus management when navigating the media and theme browsers. - #13816

Closed
afercia wants to merge 10 commits into
WordPress:trunkfrom
afercia:prevent-unnecessary-announcements-media-theme-browsers
Closed

afercia wants to merge 10 commits into
WordPress:trunkfrom
afercia:prevent-unnecessary-announcements-media-theme-browsers

Conversation

@afercia

@afercia afercia commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Trac ticket: https://core.trac.wordpress.org/ticket/65746

Use of AI Tools

None


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions

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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props afercia.

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

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@afercia
afercia requested a review from joedolson October 1, 2026 08:13
@afercia
afercia force-pushed the prevent-unnecessary-announcements-media-theme-browsers branch from 6c2e909 to 63ef239 Compare October 6, 2026 11:02
@afercia afercia changed the title Do not move focus when navigating the media library attachments dialog. Improve focus management when navigating the media and theme browsers. Oct 8, 2026
@afercia afercia added the props-bot Adding this label triggers the Props Bot workflow for a PR. label Oct 8, 2026
@github-actions github-actions Bot removed the props-bot Adding this label triggers the Props Bot workflow for a PR. label Oct 8, 2026
@afercia
afercia force-pushed the prevent-unnecessary-announcements-media-theme-browsers branch from 63ef239 to 015d05c Compare October 8, 2026 10:58
@afercia
afercia force-pushed the prevent-unnecessary-announcements-media-theme-browsers branch from 015d05c to 1dc9ff8 Compare October 8, 2026 11:30
wporg-sync pushed a commit that referenced this pull request Oct 8, 2026
…nts when navigating the media and theme browsers.

In the various media and theme browsers, the announcements for screen readers were sometimes too noisy because focus was set too often and unnecessarily on some elements. To improve the announcements and move focus only when really necessary, all the media and theme browsers are now standardized to the following pattern:

- Makes sure all the media and theme browsers have a dialog role.
- Keeps the navigation buttons focusable by using `aria-disabled` instead of `disabled`.
- Ensures that screen reader announcements are cleaner by keeping focus on the activated control rather than moving it to another element.
- Makes sure initial focus is set to the dialog element when it is opened.
- Makes sure to return focus to the opener control when the dialog is closed.
- Makes sure the opener control is a focusable element.
- Adjusts styles accordingly to take the `aria-disabled` attribute into account.
- Simplifies the buttons accessible name to: Previous / Next / Close.
- Makes sure the ARIA live regions are not hidden when they inherit `visibility: hidden`.

Developed in #13816

Props sukhendu2002, khokansardar, afercia.
Fixes #65746.


git-svn-id: https://develop.svn.wordpress.org/trunk@64241 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 64241
GitHub commit: 7f90101

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Oct 8, 2026
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Oct 8, 2026
…nts when navigating the media and theme browsers.

In the various media and theme browsers, the announcements for screen readers were sometimes too noisy because focus was set too often and unnecessarily on some elements. To improve the announcements and move focus only when really necessary, all the media and theme browsers are now standardized to the following pattern:

- Makes sure all the media and theme browsers have a dialog role.
- Keeps the navigation buttons focusable by using `aria-disabled` instead of `disabled`.
- Ensures that screen reader announcements are cleaner by keeping focus on the activated control rather than moving it to another element.
- Makes sure initial focus is set to the dialog element when it is opened.
- Makes sure to return focus to the opener control when the dialog is closed.
- Makes sure the opener control is a focusable element.
- Adjusts styles accordingly to take the `aria-disabled` attribute into account.
- Simplifies the buttons accessible name to: Previous / Next / Close.
- Makes sure the ARIA live regions are not hidden when they inherit `visibility: hidden`.

Developed in WordPress/wordpress-develop#13816

Props sukhendu2002, khokansardar, afercia.
Fixes #65746.

Built from https://develop.svn.wordpress.org/trunk@64241


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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant