Make WordPress Core

Timestamp:
06/21/2024 06:15:50 PM (5 weeks ago)
Author:
joedolson
Message:

Administration: A11y: Add role="alert" on JS injected admin notices.

Add the attribute role="alert" on 12 instances of admin notices that are injected into the DOM using JavaScript. The role="alert" attribute allows screen readers to recognize the addition to the DOM and announce the errors to users.

Props afercia, cyrus11, rcreators, joedolson.
Fixes #47111.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/customize/widgets.js

    r57987 r58455  
    16241624                // @todo This should use the Notifications API introduced to panels. See <https://core.trac.wordpress.org/ticket/38794>.
    16251625                noticeContainer = $( '<div></div>', {
    1626                     'class': 'no-widget-areas-rendered-notice'
     1626                    'class': 'no-widget-areas-rendered-notice',
     1627                    'role': 'alert'
    16271628                });
    16281629                panelMetaContainer.append( noticeContainer );
Note: See TracChangeset for help on using the changeset viewer.