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

Add separator to the required owned elements list of menu #1844

Open
WilcoFiers opened this issue Nov 2, 2022 · 5 comments
Open

Add separator to the required owned elements list of menu #1844

WilcoFiers opened this issue Nov 2, 2022 · 5 comments
Assignees
Labels
clarification clarifying or correcting language that is either confusing, misleading or under-specified Role Content Model
Milestone

Comments

@WilcoFiers
Copy link
Contributor

The menuitem, menuitemcheckbox, and menuitemradio descriptions say the following:

Source: https://w3c.github.io/aria/#menuitem
Authors MAY separate menu items into sets by use of a separator or an element with an equivalent role from the native markup language.

While it isn't explicit, presumably this means that separator should be in the list of required owned elements for menu. Happy to open a PR for this is if people think this is right.

@JAWS-test
Copy link
Contributor

The problem is that a menu must contain menuitem/-radio/-checkbox or group (unless empty menus are also allowed), but a separator is allowed but not required. It would be useful if the entire ARIA specification specified required and allowed child/parent roles for all roles.

@scottaohara
Copy link
Member

This may be resolved with @smhigley's work on revising owned elements. Agree with JAWS-test's initial response though that separator is not "required". arguably, it may be better to group menuitems by use of role=group encapsulation rather than including separators... those could be done via styling, since arguably they should not even be discoverable to users who would (at-dependent) be in forms mode when navigating the menuitems

@MelSumner
Copy link
Contributor

MelSumner commented Jan 18, 2023

I agree with @WilcoFiers here; I have an interpretation to offer.

In its simplest form, we've long since taught to code a navigation like this:

<nav>
  <ul>
    <li>...</li>
    <li>...</li>
  </ul>
</nav>

and to use role="separator" when we intend such:

<nav>
  <ul>
    <li>...</li>
    <li>...</li>
    <li role="separator">...</li>
    <li>...</li>
    <li>...</li>    
  </ul>
</nav>

I would expect separator to require being owned by a list/menu/menubar. While they (list/menu/menubar) do not require owning a a separator, a separator does require being owned by one of them.

Referencing, explicitly, this excellent guide for creating navigations: https://adrianroselli.com/2017/10/dont-use-aria-menu-roles-for-site-nav.html

The proffered examples on the APG site are really super overdone; if there are cases where that kind of markup is genuinely required, those instances should be very clearly marked as such. But they're just overkill.

@scottaohara
Copy link
Member

@MelSumner your example of how to use a separator in a list would presently (correctly) return errors from conformance checkers (maybe don't disable this, per your linked PR?). Not saying it isn't something to consider to allow, I actually created this test case back in October, thinking i might open an issue with HTML to allow <hr> within lists (thus then allowing role=separator within a role=list). But doing so would also require some additional bugs to be filed against browsers or screen readers, or maybe both, due to inconsistencies in how the inclusion of the separator is announced (or not), how it impacts the exposed number of list items (or not), or in the case of Firefox/Talkback, how it completely breaks the way the list item numeration is exposed.

@WilcoFiers
Copy link
Contributor Author

It's not list, but menu (and menubar?) I'm after on this. I'm adding an exception for it to axe-core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification clarifying or correcting language that is either confusing, misleading or under-specified Role Content Model
Projects
None yet
Development

No branches or pull requests

6 participants