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/themes.css

    r63998 r64241  
    14071407}
    14081408
     1409/* Make sure the ARIA live regions are visible, as they inherit the hidden visibility from the body. */
     1410.a11y-speak-intro-text,
     1411.a11y-speak-region {
     1412        visibility: visible;
     1413}
     1414
    14091415.wp-full-overlay {
    14101416        background: #1d2327;
    … …  
    15621568}
    15631569
     1570.theme-install-overlay .close-full-overlay:focus,
     1571.theme-install-overlay .previous-theme:focus,
     1572.theme-install-overlay .next-theme:focus {
     1573        /* Always visible also in Windows High Contrast mode */
     1574        outline: 1px solid #c3c4c7;;
     1575        outline-offset: -1px;
     1576}
     1577
    15641578.theme-install-overlay .close-full-overlay::before {
    15651579        font: 400 22px/1 dashicons;
    … …  
    15981612        background: #f0f0f1;
    15991613        cursor: default;
    1600         pointer-events: none;
    16011614}
    16021615
Note: See TracChangeset for help on using the changeset viewer.