Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#37556 closed defect (bug) (fixed)

Shiny Updates: aria-label not updated on failure on plugins.php

Reported by: afercia's profile afercia Owned by: ocean90's profile 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}...":

https://cldup.com/4rXFVKzWMV.png

Instead, in plugin-install.php the aria-label gets correctly updated:

https://cldup.com/bxOQqyUjxa.png

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.

https://cldup.com/oLIu3ddy2m.png

NVDA doesn't and reads out the existing text instead:

https://cldup.com/lsFCI-Yv4F.png

Patch incoming.

Attachments (3)

37556.diff (1.2 KB) - added by afercia 8 years ago.
37556.2.diff (2.7 KB) - added by ocean90 8 years ago.
37556.3.diff (1.8 KB) - added by ocean90 8 years ago.

Download all attachments as: .zip

Change History (13)

@afercia
8 years ago

#1 @afercia
8 years ago

  • Keywords has-patch added; needs-patch removed

37556.diff introduces the proposed fix also for the plugin "cards" in plugin-install.php.

This ticket was mentioned in Slack in #feature-shinyupdates by afercia. View the logs.


8 years ago

#3 @ocean90
8 years ago

  • Milestone changed from Awaiting Review to 4.7

#4 @ocean90
8 years ago

  • Milestone changed from 4.7 to 4.6

@ocean90
8 years ago

@ocean90
8 years ago

#5 @ocean90
8 years ago

  • Keywords commit added

37556.3.diff removes the aria labels if the Ajax response is invalid.

#6 @afercia
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 );

This ticket was mentioned in Slack in #feature-shinyupdates by ocean90. View the logs.


8 years ago

#8 @DrewAPicture
8 years ago

  • Keywords dev-reviewed added

37556.3.diff looks good.

#9 @ocean90
8 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 38196:

Plugins: Also update aria-labels when a plugin update fails.

Previously the label was stuck at "Updating…".

Props afercia, ocean90.
Props DrewAPicture for review.
Fixes #37556.

#10 @ocean90
8 years ago

In 38197:

Plugins: Also update aria-labels when a plugin update fails.

Previously the label was stuck at "Updating…".

Merge of [38196] to the 4.6 branch.

Props afercia, ocean90.
Props DrewAPicture for review.
See #37556.

Note: See TracTickets for help on using tickets.