WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#34756 closed defect (bug) (fixed)

Accessibility improvements for Posts Quick Edit and Bulk Edit

Reported by: afercia Owned by: afercia
Milestone: 4.5 Priority: normal
Severity: normal Version: 4.3
Component: Quick/Bulk Edit Keywords: has-patch commit
Focuses: ui, accessibility, javascript Cc:
PR Number:

Description

As done in #34613 for the Tags and Categories Quick Edit form, it would be nice to improve keyboard interaction in the Posts Quick/Bulk Edit forms and avoid focus losses.
When saving or canceling is done with JavaScript, the corresponding focused button gets hidden so focus is lost.
Some browser (e.g. Firefox) are smarter and try to keep focus "in place" but Chrome and other ones lose focus and force users to start tabbing again from the document root.

Also, there is no audible feedback message for screen reader users when saving is successful.

Attachments (3)

34756.patch (3.8 KB) - added by afercia 4 years ago.
34756.2.patch (4.2 KB) - added by afercia 4 years ago.
34756.3.patch (4.3 KB) - added by afercia 4 years ago.

Download all attachments as: .zip

Change History (10)

#1 @afercia
4 years ago

First pass. For Quick Edit, when pressing Cancel or Update, focus is moved back to the Post title. When saving is successful or gives error, a message is dispatched to wp.a11y.speak()

For Bulk Edit: when saving, there's a page reload so there's nothing to do with JavaScript.
When pressing "Cancel", there may be several Post checked for editing, need to make a decision about where focus should be moved back. For now, it is moved back to the first checked checkbox in the Posts list. Would like to discuss a bit this with the Accessibility Team and anyone who may be interested of course :)

https://cldup.com/Nxb6w47a_V.png

Last edited 4 years ago by afercia (previous) (diff)

@afercia
4 years ago

#2 @afercia
4 years ago

  • Keywords has-patch added

#3 @afercia
4 years ago

  • Milestone changed from Awaiting Review to 4.5
  • Owner set to afercia
  • Status changed from new to assigned

@afercia
4 years ago

#4 @afercia
4 years ago

  • Keywords commit added

Refreshed patch. Since [35771] the row action links are always focusable, even when they're not visible. This allows to move focus back to the most logical place, i.e. the UI control that opened the Quick/Bulk edit form. So, to recap:

  • Quick Edit "Cancel" or "Update" will move focus back to the Quick Edit link
  • Bulk Edit "Cancel" will move focus back to the "Apply" top or bottom Bulk Actions button
  • Bulk Edit "Update" reloads the page, nothing to do here

Note: a similar change should be done also for inline-edit-tax.js.

#5 @afercia
4 years ago

There are a couple of things left to make the Bulk Edit usable with a keyboard, like making the delete "X" focusable and setting the initial focus on the form. Will handle them in a separate ticket.

https://cldup.com/dYs0pSLK4M.png

@afercia
4 years ago

#6 @afercia
4 years ago

Refreshed patch, forgot to import wp.

#7 @afercia
4 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 36303:

Accessibility: Improve focus handling and audible feedback on the Posts Quick-Bulk Edit.

Avoids a focus loss when saving or closing the form moving focus back to a proper place.
Uses wp.a11y.speak() to dispatch successful edits and error messages to screen readers.

Fixes #34756.

Note: See TracTickets for help on using tickets.