Multi block selection: Block Switcher misleading label and tooltip #51917
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Package] Block editor
/packages/block-editor
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
[Type] Regression
Related to a regression in the latest release
Description
When selecting multiple block, the Block toolbar shows commands that are applicable to the set of selected blocks. So far so good.
In the toolbar, the Block Switched button shows the ‘copy’ icon. Could be better, but yes: so far so good.
However, the aria-label and the tooltip text refer to the first block title. Not sure it makes any sense. I would expect it would tell users it’s a multi-selection state or something along those lines.
The label and tooltip actually are the title of the first block in the set of selected blocks:
Also, the Block switcher button has a visually hidden description, associated by the means of
aria-describedby
. The text of the description does refer to the multi-selection state and it'sChange type of %d blocks
but it doesn't make sense in combination with the first block title.Actually, screen reader users will hear something like:
Quote. Change type of 3 blocks
Turns out with multi-selection the label of the Block switcher button used to be
Change type of %d blocks
. It was changed to the first block title in #26135The current labeling + description doesn't make sense. I would expect it to be something like:
Label: Multiple blocks selected
Description: Change type of %d blocks
It should be more concise that that, because the label becomes visible when the preference 'Show button text labels' is enabled:
Looking at the code, the description was made conditional and changes depending on whether there's a multi-block selection. Instead, the label is always the block title, which doesn't seem correct. It should change conditionally as well.
Additionally:
I'd also suggest to improve a bit the labeling + description for the single selection state. In this case, the Description repeats the block title, which is redundant and just adds noise:
Step-by-step reproduction instructions
Change type of %d blocks
.Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: