-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add role="alert" to New Alert Designs #1696
Comments
Worth while looking at what the U.S. Web Design System (USWDS) https://designsystem.digital.gov/components/alert/ Which does recommend :
Mind you GDS doesn't seem to recommend it Frankly their HTML doesn't have much of any semantic value. |
Some more discussion here alphagov/govuk-design-system-backlog#71 |
@mgifford I tried using NVDA on different examples of pages with role="alert" as a static function. And the browser support is very inconsistant to me. Sometimes it will read the alert as the first thing before navigating anywhere (which is okay if it's the first thing on the page, but what if there are multiple ones throughout the page?). The other times, it does not provide any extra context to the screen reader (does not tell me it's an alert). I also used JAWS inspect and it did not recognize the text in the alert as anything more than text. I think for consistant experience for screen readers across multiple platforms, the governance should include adding invisible text to the alert to say "warning alert" or "alert - warning". something to that effect. The UK gov site you linked to has that very thing. If it's really detrimental and needs to be consistant throughout the agency, I don't know if there might be an appetite to use scripting to auto inject the phrase into the alert, similar to what we do with some of the other dynamic designs like expand/collapse. |
In looking at this more deeply I think that the role="alert" only occurs in an error message which is provided in response to some form of input (ie a form) where an active announcement would be expected. As for support for ARIA, it isn't as good as any of us would like, but here's a list of supported browsers from 2012: Also worth seeing: It could also be that it isn't set up correctly https://stackoverflow.com/questions/55129929/ie-role-alert-is-not-read-on-page-load |
The Australian Gov says this for their alerts: https://designsystem.gov.au/components/page-alerts/rationale/ Using role="alert" will immediately interrupt assistive technology to inform users of the alert and for this reason should be used sparingly. We recommend only using the role="alert" when there is important time-sensitive information that would be detrimental for a user to miss." |
Excellent, user testing. Thanks Chad. Plus links back to documentation that indicates when it is most useful.
Probably all of which should be following the styling from the New Alert Designs. It might be worth adding something to the documentation pointing to the Australian example, but it seems clear that it |
Coming from wet-boew/wet-boew#8886
I just want to know if this was considered, especially for the Danger alert below:
I do not know if this is appropriate or if it would much of a benefit to screen reader users.
The text was updated successfully, but these errors were encountered: