dequelabs / dequelabs/axe-core
Issue with aria-required-children validation fix messaging
- Dominant language
- JavaScript
- Stars
- 7.5k
- Forks
- 933
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 17
Description
### Product
axe-core
### Product Version
4.10.3
### Latest Version
- [x] I have tested the issue with the latest version of the product
### Issue Description
#### Actual
Getting an issue flagged with a test of a menu component. This is what appears in the DOM:
```
-
Save & Exit
```
Note that the immediate child of the ul with role=”menu” is an li with role=”presentation”. This node would ordinarily be ignored, but it also (incorrectly) has tabindex=”-1” so the validation is regarding it as not presentational. The issue that is raised provides this “how to fix”:
Element has children which are not allowed: [role=presentation]
This is misleading as to the actual fix. If we were able to indicate that the issue was not that the role=”presentation” marked element wasn’t allowed but that that element couldn’t be tabbable that would make more sense and support a fix more clearly.
The opposite issue is similarly affected, as on this same page as the element within the li with role=”presentation” gets flagged for a aria-required-parent issue and the “how to fix” says:
Required ARIA parents role not present: menu, menubar, group
#### How to Reproduce
Take any good menu component and add tabindex="-1" to an element between the element with role="menu" and the element with role="menuitem".
Contributor guide
Assessment
This issue has not been assessed yet.