Closed
Description
openedon Dec 29, 2023
Description
See #56817
The 'Template preview' menu item in the template manu has:
role="menuitem"
aria-pressed
true or false
This is incorrect. The aria-pressed state can only be used with the role=button
(native buttons or elements with that ARIA role).
It's not just a matter of forma compliance. Screen readers will not announce the 'selected' state of the menu item. This should be instead:
- role="menuitemcheckbox"
aria-checked
true or false
It's no different from what already done for other dropdown with role="menu"
, for example the Options nenu:
- A role="menu" should only contain menuitem, menuitemcheckbox, menuitemradio, and optionally groups.
- Normal menu items have a
menuitem
role. - Menu items with a checkable state must either have a menuitemcheckbox or a menuitemradio role.
- For both menuitemcheckbox and menuitemradio roles,
aria-checked
is a required state.
Step-by-step reproduction instructions
- Test with Safari and VoiceOver.
- Tab to the template menu in the Document settings and open it.
- Tab to the 'Template preview' menu item and press Control+Option+Spacebar to check it and uncheck it.
- Observe that in both checked and unchecked states, the state is not announced.
Regardless of the visual checked state and the (incorrect) aria-pressed value, VoiveOver always announce the item as 'menu item' and does not announce the state. Screenshot:
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment