#46995 closed enhancement (invalid)
Notifications need ARIA `role` attribute of either `status` or `alert` for accessibility purposes
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | |
Focuses: | accessibility | Cc: |
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.
6 years ago
#5
@
6 years ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
- Version 5.1.1 deleted
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.
@dannylonglegs thanks for your report. It's important to note that
role=status
androle=alert
are 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.