uswds icon indicating copy to clipboard operation
uswds copied to clipboard

Make site-alert more accessible to screenreaders

Open werdnanoslen opened this issue 3 years ago • 1 comments

Describe the bug

The site-alert component doesn’t have any way of raising its importance to screen readers. I consider this a usability/a11y bug, but may be more appropriate as a feature.

Steps to reproduce the bug

  1. Start a session with a site-alert, or have a site alert appear during a session (e.g. via a flag for emergency site maintenance)
  2. Either way, if a user were to use a screenreader to skip to <main>, or tab to the first button/field, or use the rotor menu (and the no-header variant is used), the alert is always skipped and effectively invisible without having SR read all content from the top.

Expected behavior

Should use a landmark role to be readily available to screenreaders, and be considered a live region in case it is important and updates within a session. This is especially true if it does not have a header and thus doesn't show up on the rotor menu either.

Status might be the most semantically appropriate role, and it would already use the ‘polite’ aria-live setting to announce a change if it comes up (e.g. suddenly a “this website will be down for maintenance in 1 hour” appears).

Alternatively, the Region role type (with none/polite aria-live setting) would at least make it appear on rotor menus in the headerless variant.

werdnanoslen avatar Mar 17 '22 19:03 werdnanoslen

Related to #3832

brunerae avatar Mar 18 '22 16:03 brunerae