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 should not flag child elements removed from the accessibility tree that also use aria-hidden #4090

Closed
1 task done
WaltGurley opened this issue Jul 14, 2023 · 2 comments · Fixed by #4091
Assignees
Labels
fix Bug fixes pr A pr has been created for the issue rules Issue or false result from an axe-core rule
Milestone

Comments

@WaltGurley
Copy link

Product

axe-core

Product Version

4.7.1

Latest Version

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

Issue Description

Expectation

If the descendent of an element with required children is removed from the accessibility tree using display: none or visibility: hidden and also uses aria-hidden:"true" it should not raise an aria-required-children issue due to "Element has children which are not allowed".

Actual

If the descendent of an element with required children is removed from the accessibility tree using display: none or visibility: hidden and also uses aria-hidden:"true" it raises an aria-required-children issue due to "Element has children which are not allowed". If visibility: hidden is removed from the child element the aria-required-children issue is not raised.

How to Reproduce

In the following examples a child element uses display: none or visibility: hidden and also uses aria-hidden:"true". In these cases an aria-required-children issue is raised:

<div role="table">
  <div role="presentation">
    <div style="display: none;" aria-hidden="true">
      this shouldn't be in the table
    </div>
    <div role="row">
      <div role="columnheader">Col 1</div>
      <div role="columnheader">Col 2</div>
    </div>
  </div>
  <div role="row">
    <div role="cell">a</div>
    <div role="cell">b</div>
  </div>
</div>

<div role="list">
  <div role="presentation">
    <div style="visibility: hidden;" aria-hidden="true">
      this shouldn't be in the list
    </div>
    <li>item 1</li>
    <li>item 2</li>
  </div>
</div>

The following examples are exactly the same as the previous examples except aria-hidden:"true" is removed from the child elements. In these cases an aria-required-children issue is not raised:

<div role="table">
  <div role="presentation">
    <div style="display: none;">this shouldn't be in the table</div>
    <div role="row">
      <div role="columnheader">Col 1</div>
      <div role="columnheader">Col 2</div>
    </div>
  </div>
  <div role="row">
    <div role="cell">a</div>
    <div role="cell">b</div>
  </div>
</div>

<div role="list">
  <div role="presentation">
    <div style="visibility: hidden;">this shouldn't be in the list</div>
    <li>item 1</li>
    <li>item 2</li>
  </div>
</div>

See Live examples

Additional context

This provided examples in the "How to reproduce" section are simplified examples of issues originally encountered when evaluating this complex grid.

@WaltGurley WaltGurley added the ungroomed Ticket needs a maintainer to prioritize and label label Jul 14, 2023
@WilcoFiers
Copy link
Contributor

@WaltGurley Confirmed. Thanks for reporting. That's very odd. We'll get it fixed ASAP.

@WilcoFiers WilcoFiers added fix Bug fixes rules Issue or false result from an axe-core rule and removed ungroomed Ticket needs a maintainer to prioritize and label labels Jul 14, 2023
@WilcoFiers WilcoFiers added this to the Axe-core 4.8 milestone Jul 14, 2023
@WilcoFiers WilcoFiers self-assigned this Jul 17, 2023
@straker straker added the pr A pr has been created for the issue label Jul 24, 2023
@padmavemulapati
Copy link

Validated using latest axe-core develop branch code base.,
with <div style="display: none;" aria-hidden="true"> not seeing any failure for aria-required-children

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes pr A pr has been created for the issue rules Issue or false result from an axe-core rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants