#46995 closed enhancement (invalid)
Notifications need ARIA `role` attribute of either `status` or `alert` for accessibility purposes
| Reported by: | dannylonglegs | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | accessibility |
Description
During a recent accessibility audit at Pressbooks, we were informed that in order for notifications to be accessible, they need and ARIA role of either status or alert.
role=alert documentation:
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Alert_Role
role=status documentation:
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_status_role
Examples in WP code:
https://github.com/WordPress/WordPress/blob/355d5f9bb76bff0a24970cea8a5be22d9ed612d4/wp-admin/themes.php#L203
These HTML elements, usually with the id="message" or class="error" should have ARIA roles.
Change History (6)
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
7 years ago
#5
@
7 years ago
- Milestone Awaiting Review
- Resolution → invalid
- Status new → closed
- Version 5.1.1
Discussed during today's accessibility bug scrub and agreed to close this ticket because "static" notifications rendered on page load won't benefit from an ARIA alert or status role.
Also, agreed to create a new ticket to address all the "dynamic" notifications, that is the ones that are rendered in the DOM "on the fly" and do need ARIA roles.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
@dannylonglegs thanks for your report. It's important to note that
role=statusandrole=alertare a specialized type of live regions. That is to say that using these roles on notifications that are rendered on page load won't have any effect. Assistive technologies won't announce the notifications content.Reference:
https://www.w3.org/TR/wai-aria-1.1/#alert
https://www.w3.org/TR/wai-aria-1.1/#status
Quoting from the Aria Authoring Practices (emphasis mine):
W3C role=alert example:
https://www.w3.org/TR/wai-aria-practices/examples/alert/alert.html
The standard admin notices in WordPress are rendered during page load. They're usually placed close to the main H1 heading so, in a way, screen reader users can find them with some content exploration. Any suggestions to improve their discoverability after page load is very welcome. I guess there should be a standardized way to generate the notices to start with.