#37556 closed defect (bug) (fixed)
Shiny Updates: aria-label not updated on failure on plugins.php
Reported by: | afercia | Owned by: | ocean90 |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | Plugins | Keywords: | has-screenshots has-patch commit dev-reviewed |
Focuses: | accessibility, javascript | Cc: |
Description
When a plugin update on plugins.php
fails, the plugin notice gets updated with an error message but the aria-label
set on the paragraph still says "Updating {plugin name}...":
Instead, in plugin-install.php
the aria-label
gets correctly updated:
The fix looks simple, checking if a plugin name is returned in the response data:
- if yes, update the aria-label using the plugin name
- if not, it's a bit pointless to use an aria label in the first place, so remove it and let screen readers read the existing text
Worth noting, while theoretically aria-label
can be used on any element, and in this case is used on a paragraph, some screen readers read this attribute only on focusable elements or elements with some specific aria role
attributes. I don't see this as a big deal in this specific case: whether screen readers will announce the aria-label
or the existing text, the important thing is to ensure the messages are appropriate.
Also, worth reminding aria-label
completely overrides the existing element text.
VoiceOver does announce the aria-label
set on the paragraph and ignores the existing text.
NVDA doesn't and reads out the existing text instead:
Patch incoming.
Attachments (3)
Change History (13)
This ticket was mentioned in Slack in #feature-shinyupdates by afercia. View the logs.
8 years ago
#5
@
8 years ago
- Keywords commit added
37556.3.diff removes the aria labels if the Ajax response is invalid.
#6
@
8 years ago
Note: during testing after the weekly dev chat @ocean90 noticed also other places where removing the aria-label
would be appropriate because the element text is clear enough. He's kindly updating the patch :) Worth noting using the same text for both the element's text and the aria-label
is a bit pointless and can be safely avoided. For example doing this on the same element:
.attr( 'aria-label', wp.updates.l10n.updateFailedShort ) ... .text( wp.updates.l10n.updateFailedShort );
37556.diff introduces the proposed fix also for the plugin "cards" in
plugin-install.php
.