Make WordPress Core

Opened 6 months ago

Closed 4 months ago

Last modified 4 months ago

#61480 closed defect (bug) (fixed)

Comment reply admin notices not announced by screen readers

Reported by: joedolson's profile joedolson Owned by: peterwilsoncc's profile peterwilsoncc
Milestone: 6.7 Priority: normal
Severity: normal Version:
Component: Comments Keywords: has-patch needs-testing
Focuses: accessibility Cc:

Description

The comment reply admin notice does not get announced by screen readers when notice content is injected into the admin notice container. This can either be resolved by role="alert" or wp.a11y.speak().

Attachments (2)

61480.role.diff (473 bytes) - added by joedolson 6 months ago.
Patch using role="alert"
61480.speak.diff (386 bytes) - added by joedolson 6 months ago.
Patch using wp.a11y.speak

Download all attachments as: .zip

Change History (15)

@joedolson
6 months ago

Patch using role="alert"

@joedolson
6 months ago

Patch using wp.a11y.speak

#1 @joedolson
6 months ago

There's no functional difference between the two patches, just a choice to make.

#2 @khokansardar
6 months ago

  • Keywords has-patch added

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


5 months ago

#4 @peterwilsoncc
5 months ago

@joedolson Either version looks like an improvement, I'm happy with either approach. Is there a best practice favouring one over the other?

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


4 months ago

#6 @joedolson
4 months ago

  • Keywords needs-testing added

Nobody else seems to have a preference; so I'm going to go with role="alert". The argument, in my opinion, is that it keeps the behavior associated directly with the call that sets up the HTML, but I don't really think it matters overall.

To test:

Using a screen reader, go to Comments. Click 'Reply' on a comment. Click the 'Reply' button primary to submit a blank comment. This will spawn an admin notice error.

Before patch: No announcement from the screen reader.
After patch: The error is announced by the screen reader.

#7 @peterwilsoncc
4 months ago

I tested each of the patches and could only get the one using JavaScript to announce the error when using VoiceOver on macOS.

It's possible that's due to a configuration error in my settings as I don't know the settings very well.

#8 follow-up: @joedolson
4 months ago

It could also be a distinction between VoiceOver and other, more standards compliant screen readers. But, it's no problem to just choose the JS driven announcement in order to get better support with VoiceOver.

This ticket was mentioned in PR #7218 on WordPress/wordpress-develop by @peterwilsoncc.


4 months ago
#9

  • Uses wp.speak to announce an error when replying to comments within the dashboard
  • Adds wp-a11y as a dependency to the JavaScript

Trac ticket: https://core.trac.wordpress.org/ticket/61480

#10 in reply to: ↑ 8 @peterwilsoncc
4 months ago

Replying to joedolson:

It could also be a distinction between VoiceOver and other, more standards compliant screen readers. But, it's no problem to just choose the JS driven announcement in order to get better support with VoiceOver.

OK, let's do that.

In the linked pull request I've added wp-a11y as a dependency to the script and included the code in 61480.speak.diff.

#11 @peterwilsoncc
4 months ago

Testing notes using Joe's patch with the inclusion of the enqueue dependency.

Test Report

This report validates that the indicated patch addresses the issue.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/7218

Environment

  • OS: macOS 14.6.1
  • Web Server: Nginx
  • PHP: 8.1.29
  • WordPress: 6.7-alpha @ r58919
  • Browser: Firefox 129.0.1
  • Theme: Twenty Twenty-Four
  • Active Plugins:
    • Query Monitor 3.16.4

Actual Results

  • ✅ Issue resolved with patch.

Testing Notes

  1. Checkout trunk without patch
  2. Run npm run build:dev
  3. Enable Voice over in System settings
  4. Open WP Dashboard Comments screen
  5. Hover over test comment
  6. Click reply link
  7. Submit empty reply
  8. ❌ Error announced
  9. Apply patch
  10. Run npm run build:dev
  11. Open WP Dashboard Comments screen
  12. Hover over test comment
  13. Click reply link
  14. Submit empty reply
  15. ✅ Error announced.

#12 @peterwilsoncc
4 months ago

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

In 58931:

Comments: Announce reply notices to screen reader users.

Improve experience for screen reader users by calling wp.a11y.speak() with the results of comment reply submissions within the WordPress dashboard.

Props joedolson, khokansardar.
Fixes #61480.

Note: See TracTickets for help on using tickets.