-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the usage of aria-haspopup #24796
Comments
If we were to pick a value to start with that's better than nothing, would it be |
When the opened UI isn't one of the cases listed by the ARIA 1.1 spec (menu, listbox, tree, grid, dialog) I'd say the safest option is |
Hi @afercia, @tellyworth,
It appears that the link format, inserter, and list view were the remaining cases lacking the aria-haspopup and aria-expanded attributes. I've submitted PR's to rectify these concerns. Are there any other cases that require attention? |
I'm closing the issue as it appears the remaining cases were addressed if there is any remaining issue feel free to reopen. |
@jorgefilipecosta thanks much for working on this. Also, nice to see you again. |
Describe the bug
The ARIA attribute
aria-haspopup
is used inconsistently across the Gutenberg UI. For example, some buttons that open a menu do usearia-haspopup
, while others don't.It is worth reminding that
aria-haspopup
changed between the ARIA 1.0 and 1.1 specifications.In ARIA 1.0: https://www.w3.org/TR/wai-aria-1.0/states_and_properties#aria-haspopup
In ARIA 1.1 it has been expanded to indicate opening of other patterns that aren't just menus: https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup
Where the allowed values are:
It is clear that the concept of "popup" evolved to represent other kind of UIs.
Regardless, right now in Gutenberg there's the need to consistently communicate to assistive technology users whether a UI control opens some kind of additional UI. Worth noting that
aria-expanded
alone isn't sufficient because it represents a state, whilearia-haspopup
is a property.Examples:
In the block toolbars, some buttons that open a menu do use
aria-haspopup
, for example:Other buttons that open a menu don't use
aria-haspopup
, for example:Screenshots:
There's also the case of a button that uses
aria-haspopup
but it opens... another toolbar. Semantically, this isn't correct and it can be confusing for users. I'll split this in a separate ticket. See the Heading block, where the "Change heading level" button opens another toolbar:Lastly, there are cases where a button opens a complex UI that is made of various parts. I'm not sure which of the
aria-haspopup
values would be the most appropriate in these cases. This would need some research and discussion. For example, see the case of the "Quick inserter" or the “Content structure” UIs. How can we properly communicate what kind of UI is going to be opened? At a first glance, the closest value might be "dialog" but this UIs aren't real ARIA dialogs.The text was updated successfully, but these errors were encountered: