dequelabs / dequelabs/axe-core

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

Open
#4,498 2 comments 0 reactions 0 assignees View on GitHub
fix rule metadata
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 23h
Merged PRs (30d)
17

Description

### Product

axe Extension

### Product Version

4.9.1

### Latest Version

- [X] 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](https://andrewhick.com/accessibility/failures.html#tablist)

Code:
```


tab

tabpanel


```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.