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

"Certain ARIA roles must contain particular children" is inconsistent with its guidance #4498

Open
1 task done
andrewhick opened this issue Jun 10, 2024 · 1 comment
Open
1 task done
Labels
fix Bug fixes rule metadata Issues in the rule metadata code (lib/rules)
Milestone

Comments

@andrewhick
Copy link

Product

axe Extension

Product Version

4.9.1

Latest Version

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

Issue Description

Expectation

The error "Certain ARIA roles must contain particular children" should be consistent with the issue that has been detected, which is that disallowed children have been found.

An alternative which would be closer to the actual detected issue is: "Certain ARIA roles must only contain particular children".

Ideally, the guidance for the error would also say what those children should be, for example, "A tablist ARIA role can only have tab roles as children".

Actual

In the example below, "Certain ARIA roles must contain particular children" suggests that if you add the right child element (tab), it will fix the issue, but this is not the case. There is a required child, but there is also a disallowed child (tabpanel).

The extension only reports on children which are not allowed, for example: "To solve this problem, you need to fix the following: Element has children which are not allowed: [role=tabpanel]"

There is no indication of what the particular children should be. So the error title is inconsistent with the subsequent guidance.

How to Reproduce

Example failing tablist

Code:

<div role="tablist">
  <div role="tab">tab</div>
  <div role="tabpanel">tabpanel</div>
</div>
@andrewhick andrewhick added the ungroomed Ticket needs a maintainer to prioritize and label label Jun 10, 2024
@github-actions github-actions bot added the extension Axe Firefox or Chrome extension issues label Jun 10, 2024
@WilcoFiers
Copy link
Contributor

@andrewhick Thank you for bringing this up. Agreed, I think we tweak the language to make this a little clearer. These messages are static, so we can't adjust them for different elements. This is what the remediation message does, which for the above example is:

Fix any of the following:
- Element has children which are not allowed: [role=tabpanel]

@WilcoFiers WilcoFiers added fix Bug fixes rule metadata Issues in the rule metadata code (lib/rules) and removed extension Axe Firefox or Chrome extension issues ungroomed Ticket needs a maintainer to prioritize and label labels Jun 11, 2024
@gaiety-deque gaiety-deque removed their assignment Jun 13, 2024
@WilcoFiers WilcoFiers added this to the Axe-core 4.11 milestone Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes rule metadata Issues in the rule metadata code (lib/rules)
Projects
None yet
Development

No branches or pull requests

3 participants