-
Notifications
You must be signed in to change notification settings - Fork 211
[menu] When should activating a menuitem close the menu? #1192
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
Comments
I think it maybe should depend on if they activate via enter or via space (at least that's what apg says) |
Oh I didn't realize that this is already spelled out here: https://www.w3.org/WAI/ARIA/apg/patterns/menubar/ Thanks Scott, or whoever wrote this! |
i did not write that :)
yes. that is the expected behavior.
note that mention of the spacebar performing an alternate action is not actually reflected in any of the demos - nor is it behavior that is found, to my knowledge, in native OS menus. APG is not a standard, after all. the docs often align with how patterns work on the native OS's the roles are derived from - but the examples also sometimes go beyond that, and these won't always be fully agreed upon, or even things that have seen wide spread adoption. hence, this nuance on the "optional" bit... i'm going to dig deeper into this topic / spit ball some ideas for consideration (not expecting they would all be what "needs" to be done) I've referenced this topic/thread before - w3c/aria#2067 - but one reason you don't typically see menus with checkboxes (where it might be common to select more than one item at a time) veer away from the auto-close action, is because there's no good way (presently) to
Another idea is that being a native control - a UA provided close button could be added (and of course should be styleable). While buttons are not allowed children of a menu at this time - there's an argument to be made that if this pattern was standardized, and this button was provided by the user agent, then it could be treated similarly to the clear button of some text fields. It's there, people can click on it, but it's not in the keyboard order. There could be discussions with AT vendors to help expose hint text for how to use multi-select menus. again, something that might be more possible with native implementations than with ARIA... |
I think this applies to |
The MacOS system menubar closes when toggling a checkbox and so does the menubar apg pattern example, and neither of them have ok/cancel buttons. |
yeah. the ok/cancel buttons will be outliers, not norms. that's not to say they couldn't be useful - but i'd also submit that it'd be awesome to auto-provide such ui, rather than rely on developers to add it themselves, if this is a thing we want to provide consistent and good ux for |
When activating a menuitem which performs an action, should it close the menu afterwards?
What about when checking or unchecking radio or checkbox menuitems?
The text was updated successfully, but these errors were encountered: