-
Notifications
You must be signed in to change notification settings - Fork 779
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
menu/menubar should be allowed to be empty #3543
Comments
Hey Sarah. Yeah I think in theory menus could be empty. Do you have any real-world example of this though? My reading of WAI-ARIA is that menus must contain at least one menuitem, or be set to aria-busy. |
@WilcoFiers the specific use case that I ran into was with a menu that allows users to search/filter menuitems, and fails when a search string didn't match anything: |
Fair enough! I'll see what we can do. You may also want to raise this with ARIA as well, since this doesn't seem valid as per Required owned elements:
|
Thanks! And yup, This prompted me to finally go back and update my allowed-children PR (w3c/aria#1454). That should fix this on the ARIA spec side of things 😄. |
Validated with the latest axe-core develop branch code base,
|
Related to #383 and #1444
This is a very similar issue to the ones about aria-required-children on list, listbox, and tree. I can't think of a reason why menu and menubar should not be allowed to be empty as well. Two scenarios where this might happen include:
I generally think the aria-required-children rule makes more sense as an allowed children check across all roles where it applies, as @WilcoFiers mentioned in this comment: #1444 (comment). The comment further down notes that only
menu
,menubar
, androw
would continue to fail when empty. I understandrow
, but I couldn't find any reason stated in that thread whymenu
/menubar
would require children, and I can't personally think of a reason why those would be exceptions.This is related to the ARIA changes in #1454, but I don't think updating menu/menubar to match list, listbox, tree, etc. would need to wait on the ARIA PR (speaking of which, going to go update that now... :D)
The text was updated successfully, but these errors were encountered: