Skip to content

False positive for aria-required-children in nested menus #3803

@PinkaminaDianePie

Description

@PinkaminaDianePie

Product

axe-core

Product Version

4.5.2

Latest Version

  • I have tested the issue with the latest version of the product

Issue Description

Expectation

Nested menus should be allowed. An element role="menu" is a valid descendant of another element with the same role.

Actual

I got a false positive

How to Reproduce

Make a test with an example from here: https://www.w3.org/WAI/ARIA/apg/example-index/menubar/menubar-navigation

Here is the simplified version of their example:

      <ul role="menu" aria-label="About" id="target">
        <li role="none">
          <a role="menuitem" href="#overview">
            Overview
          </a>
        </li>
        <li role="none">
          <a role="menuitem"
             aria-haspopup="true"
             aria-expanded="false"
             href="#facts">
            Facts
          </a>
          <!-- remove this ul and test would pass -->
          <ul role="menu" aria-label="Facts">
            <li role="none">
              <a role="menuitem" href="#history">
                History
              </a>
            </li>
          </ul>
        </li>
      </ul>

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixBug fixesprA pr has been created for the issuerulesIssue or false result from an axe-core rule

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions