menu/menubar should be allowed to be empty
See original GitHub issueThis 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:
- A menu’s commands are loaded dynamically when it is opened, and it does not contain menuitems when in the loading state
- There is a way to filter commands in a menu, and the user types in a string that does not match any menuitems. (This is the scenario where I’m currently running into the issue)
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: https://github.com/dequelabs/axe-core/issues/1444#issuecomment-476868942. The comment further down notes that only menu
, menubar
, and row
would continue to fail when empty. I understand row
, but I couldn’t find any reason stated in that thread why menu
/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… 😄)
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Thanks!
And yup, This prompted me to finally go back and update my allowed-children PR (https://github.com/w3c/aria/pull/1454). That should fix this on the ARIA spec side of things 😄.
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: