-
Notifications
You must be signed in to change notification settings - Fork 118
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
Provide examples of types of menus #2056
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Valerie Young <spectranaut@igalia.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should address more of the most misunderstood aspects of appropriate menu usage and reference the APG. I provided a specific suggestion.
@@ -5289,7 +5289,7 @@ <h4>Plain HTML or Polyfill DOM Result of the MathML Quadratic Formula</h4> | |||
<rdef>menu</rdef> | |||
<div class="role-description"> | |||
<p>A type of <a>widget</a> that offers a list of choices to the user.</p> | |||
<p>A menu is often a list of common actions or functions that the user can invoke. The <code>menu</code> <a>role</a> is appropriate when a list of menu items is presented in a manner similar to a menu on a desktop application.</p> | |||
<p>A menu is a popup list of items that represent a set of actions or functions a user can invoke. The menu and list of <code>menuitems</code> are almost always directly related to the item that the user interacted with to reveal the menu. The <code>menu</code> <a>role</a> is appropriate when a list of menu items is presented in a manner similar to a menu on a desktop application. For instance, a menu could be used to represent a context menu for its invoking element, or it would be used to render sub-menus for items of a <rref>menubar</rref> or another <code>menu</code> popup.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can further simplify and clarify this language. I believe it is also important to specify that activating menuitems close menus, to enumerate how menus are triggered, and provide a link to APG.
<p>A menu is a popup list of items that represent a set of actions or functions a user can invoke. The menu and list of <code>menuitems</code> are almost always directly related to the item that the user interacted with to reveal the menu. The <code>menu</code> <a>role</a> is appropriate when a list of menu items is presented in a manner similar to a menu on a desktop application. For instance, a menu could be used to represent a context menu for its invoking element, or it would be used to render sub-menus for items of a <rref>menubar</rref> or another <code>menu</code> popup.</p> | |
<p>A menu is a popup containing a set of <code>menuitem</code> elements that can be invoked to perform an action or function. The actions are nearly always directly related to the element that the user activated to popup the menu. The <code>menu</code> <a>role</a> is appropriate when a popup is presented and behaves in a manner similar to a menu on a desktop application. activating a <code>menuitem</code> both performs the action and causes the popup to close.</p> | |
<p>Menu popups can be triggered by:</p> | |
<ul> | |
<li>Activating a <code>menuitem</code> that has <pref>aria-haspopup</pref> set to <code>true</code> in a parent <code>menu</code> or <rref>menubar</rref>. | |
<li>Activating a <rref>button</rref> that has <pref>aria-haspopup</pref> set to <code>true</code>. | |
<li>Executing a command that triggers a context menu for an element.</li> | |
</ul> | |
<p>See the <a href="https://www.w3.org/WAI/ARIA/apg/patterns/menubar/">WAI-ARIA Authoring Practices</a> for more details about implementing menus.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it odd to link to the APG page that only has menubar examples, from the menu definition?
not part of my previous PR, but this suggestion made me realize do we need to change the instance of <code>menuitem</code>
to just say "menu item" - so as to not imply that only menuitem
elements are allowed, and not also menuitemradio
and menuitemcheckbox
?
For the activation of menuitems, does that belong in the menuitem
section? In other words, taking menuitemcheckbox
into consideration, is it always true that activating one of those should cause a menu popup to close?
Pending those above questions, I'm otherwise good with these suggestions. I just don't know if they all belong in just this menu
update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcking65 re-ping on my questions concerning your suggested updates, so we can move this along
I would love to see this PR move forward. |
Closes #1084
Updated menu content to attempt to help differentiate
menu
andmenubar
, per the request of the original issue.Preview | Diff