aria icon indicating copy to clipboard operation
aria copied to clipboard

Spec for menu/menuitem does not provide enough author guidance for structure

Open aleventhal opened this issue 1 year ago • 12 comments

Describe your concern

UAs/ATs need a way to determine the parent menuitem that caused a menu to be opened. This is important for Talback on Android, which provides the name of the menu along with the choices.

While the spec does not provide this, somehow the ARIA Authoring Practices Guide does, which says: "If activating a menuitem opens a submenu, the menuitem is known as a parent menuitem. A submenu's menu element is:

  • Contained inside the same menu element as its parent menuitem.
  • Is the sibling element immediately following its parent menuitem."

If this is generally followed, it would allow the UA to determine which menuitem opened a given submenu, by navigating from the role="menu" object to the previous sibling in the accessible object tree.

One caveat is that this is also slightly incomplete, because it says "sibling element" instead of "sibling accessible object". Authors should also be able to use aria-owns to create these relationships. The important thing is the final tree structure, not the DOM structure.

Link to the version of the specification or documentation you were looking at at.

https://w3c.github.io/aria/#menuitem https://w3c.github.io/aria/#menu https://www.w3.org/WAI/ARIA/apg/patterns/menubar/

Link to documentation:

Does the issue exists in the editors draft (the editors draft is the most recent draft of the specification)?

Yes

aleventhal avatar Aug 01 '24 13:08 aleventhal