WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.34k stars 4.13k forks source link

Aligning Blocks: Need Confirmation That Block is Aligned #21941

Open donalirl opened 4 years ago

donalirl commented 4 years ago

Describe the bug When aligning blocks in the block editor using a screen reader, there is no verbal confirmation that the block aligned successfully. A visually-impaired user needs verbal feedback to know that the block contents are aligned.

To reproduce Steps to reproduce the behavior:

  1. Open up any page or post and insert a block that has alignment options in the toolbar (such as paragraph or audio)
  2. Using a screen reader, navigate to the block toolbar and select align left, right or center
  3. Observe the lack of clear confirmation

Expected behavior I expected verbal feedback along the lines of "block aligned center".

Screenshots

Screen recording: https://d.pr/v/PwvxqC (this shows WordPress.com but please note I can recreate on a self-hosted installation as well.

Editor version (please complete the following information):

Desktop (please complete the following information): Chrome (latest), Windows 10 Chrome (latest) on android Safari (latest) on iPhone

enriquesanchez commented 4 years ago

I agree the change could be communicated better.

2020-04-28 15-53-07 2020-04-28 15_55_35

After I change the text alignment, I get "Default has been selected". I'm not sure why this is being announced.

@afercia @Ryokuhi I'd love to hear what you think.

afercia commented 4 years ago

Turns out that string is used for an audible message in the downshift package, which is used for the custom select component. I can't reproduce it on my local installation though.

This function comes from downshift:

/**
 * Returns a message to be added to aria-live region when item is selected.
 *
 * @param {Object} selectionParameters Parameters required to build the message.
 * @returns {string} The a11y message.
 */

function getA11ySelectionMessage(selectionParameters) {
  var selectedItem = selectionParameters.selectedItem,
      itemToStringLocal = selectionParameters.itemToString;
  return itemToStringLocal(selectedItem) + " has been selected.";
}

If someone else can reproduce this consistently, then it's definitely a wrong behavior.

afercia commented 4 years ago

One of the places where downshift is used, is the font size picker. Downshift implements its own aria-live region. Each time a font size is selected, a message is sent to this aria-live region:

font-size-picker-downshift-aria-live

I have no idea why this gets announced when aligning text though.

Important: Also, I see at least two serious issues with the downshift aria-live region:

@enriquesanchez would you mind creating a new issue please, when you have a chance?

inaikem commented 3 years ago

@afercia, @enriquesanchez 👋 Just checking in to see if any progress has been made since the last comment here. Do you know if a new issue was created? Thanks!