Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Provide examples of types of menus #2056

wants to merge 2 commits into from

Conversation

scottaohara
Copy link
Member

@scottaohara scottaohara commented Oct 6, 2023

Closes #1084

Updated menu content to attempt to help differentiate menu and menubar, per the request of the original issue.


Preview | Diff

index.html Outdated Show resolved Hide resolved
Co-authored-by: Valerie Young <spectranaut@igalia.com>
Copy link
Contributor

@mcking65 mcking65 left a 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>
Copy link
Contributor

@mcking65 mcking65 Oct 18, 2023

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.

Suggested change
<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>

Copy link
Member Author

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?

Copy link
Member Author

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

@MrHBS
Copy link

MrHBS commented Dec 28, 2023

I would love to see this PR move forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the difference between menu and menubar clearer
5 participants