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

aria-required-children violation for seemingly valid use of group role in menu/menubar #2535

Closed
JustSlone opened this issue Oct 1, 2020 · 2 comments
Assignees
Labels
fix Bug fixes rules Issue or false result from an axe-core rule
Milestone

Comments

@JustSlone
Copy link

Hey folks, it looks like in version 4.0.0 the update to the aria-required-children rule fixing (I think) this issue: #2076 caused the following structure to be invalid:

<div role="menu">
  <ul role="group">
    <li role="menuitem">Inbox</li>
    <li role="menuitem">Archive</li>
    <li role="menuitem">Trash</li>
  </ul>
  <ul role="group">
    <li role="menuitem">Custom Folder 1</li>
    <li role="menuitem">Custom Folder 2</li>
    <li role="menuitem">Custom Folder 3</li>
  </ul>
  <ul role="group">
    <li role="menuitem">New Folder</li>
  </ul>
</div>

Repro: https://codepen.io/justslone-the-encoder/pen/KKzLLrz?editors=1111
gist of HTML for convenience

I'm not sure this was an intended consequence of the rule change made in version 4.0.0 as this structure seems valid and useful. Also this structure is allowed per the ARIA 1.2 specification

Expectation: Per ARIA 1.2 menubar spec and general examples on the use of the group role (Example 2 here) this should not be a violation
Actual: Errors are thrown for aria-required-children and aria-required-parent

Motivation: It seems this normal use of the group role should not be deemed invalid. Also since axe is used for validating accessibility conformance broadly, introducing this violation now will require sites to change away from a valid structure, only to change back again once 1.2 is final.


axe-core version: 4.0.0+
axe-webdriver, extension or other integration version: N/A
@JustSlone JustSlone changed the title aria-required-children violation for seemingly valid use of group role in menubar aria-required-children violation for seemingly valid use of group role in menu/menubar Oct 1, 2020
@straker
Copy link
Contributor

straker commented Oct 13, 2020

Thanks for the issue, looks like we're missing the group role from a few roles.

@padmavemulapati
Copy link

Verified with the latest axe-core-develop branch code , dated - 08/12/2020-
aria-required-children and aria-required-parent are showing correct results when added role="group"
code snippet for pass:<div role="menu" id="target"><ul role="group"><li role="menuitem">Menuitem</li></ul></div>
Pass- condition screenshot:
image

code snippet for voilation:

  1. role allows group and group does not have required child
    <div role="menu" id="target"><ul role="group"><li>Menuitem</li></ul></div>
    2.fail when role does not allow group
    <div role="listbox" id="target"><ul role="group"><li role="option">Option</li></ul></div>

Fail- condition screenshot:
image

@straker straker closed this as completed Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes rules Issue or false result from an axe-core rule
Projects
None yet
Development

No branches or pull requests

4 participants