-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Show button text labels setting fails to address accessibility when the visible label and the accessible name mismatch #42236
Description
Description
One of the main reasons why the 'Show button text labels' preference was implemented is to help speech recognition software users to use the Editor.
These users need to actually see a control name to be able to voice a command with their speech recognition software. For this to work, the visible text of a control must match (or at least start with) the actual accessible name. See also:
WCAG Success Criterion 2.5.3 Label in Name
https://www.w3.org/TR/WCAG21/#label-in-name
However, in the top toolbar, the block inserter toggle visible text mismatch its accessible name. Speech recognition software users won't be able to quickly activate this control with a voice command.
As a general principle: the accessible name of a control must be visually exposed in some way. The visible label (whether it's the actual button visible text or a tooltip component) must match (or at least start with) the accessible name.
Step-by-step reproduction instructions
- Click 'Options' in the top bar.
- Click 'Preferences' to open the Preferences modal dialog.
- Enable 'Show button text labels' and close the modal dialog.
- Observe the editor top toolbar: buttons now show text labels instead of icons.
- Using your browser's dev tools, inspect the source of the 'Add' button.
- Observe the button has an
aria-label="Toggle block inserter"attribute: this determines its accessible name. - Observe the visible button text is 'Add'.
Optionally test with speech recognition software. For example on macOS:
- Enable Voice Control in System Preferences > Accessibility.
- Use Safari, as it works better with Voice Control.
- With Voice Control running, voice the command 'Click Tools': the Tools menu will open.
- Note: sometimes the voice command isn't correctly recognized due to pronunciation or background noise. If that's the case, try again.
- Try with 'Click Details' to open the Details popup.
- Try with 'Click List View' to open the List View sidebar.
- Now try with 'Click Add': nothing happens.
- Try with 'Click Toggle block inserter', the inserter will open.
Unfortunately, users can't see the actual accessible name Click Toggle block inserter. Instead, they see Add and they will try to use that word. Basically, the 'Show button text labels' preference fails to fully address the accessibility need it was designed for.
Screenshots, screen recording, code snippet
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
