Make WordPress Core


Ignore:
Timestamp:
10/08/2026 11:33:48 AM (9 days ago)
Author:
afercia
Message:

Administration: Improve focus management and screen reader announcements 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 ​https://github.com/WordPress/wordpress-develop/pull/13816

Props sukhendu2002, khokansardar, afercia.
Fixes #65746.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/colors/_admin.scss

    r63996 r64241  
    774774        &.wp-customizer .theme-overlay .theme-header .close:focus,
    775775        &.wp-customizer .theme-overlay .theme-header .close:hover,
    776         &.wp-customizer .theme-overlay .theme-header .right:focus,
    777         &.wp-customizer .theme-overlay .theme-header .right:hover,
    778         &.wp-customizer .theme-overlay .theme-header .left:focus,
    779         &.wp-customizer .theme-overlay .theme-header .left:hover {
     776        &.wp-customizer .theme-overlay .theme-header .right:focus:not(.disabled),
     777        &.wp-customizer .theme-overlay .theme-header .right:hover:not(.disabled),
     778        &.wp-customizer .theme-overlay .theme-header .left:focus:not(.disabled),
     779        &.wp-customizer .theme-overlay .theme-header .left:hover:not(.disabled) {
    780780                border-bottom-color: variables.$button-color;
    781781                color: variables.$link;
Note: See TracChangeset for help on using the changeset viewer.