dequelabs / dequelabs/axe-core
label-content-name-mismatch in ARIA switch compares value text with name
- Dominant language
- JavaScript
- Stars
- 7.5k
- Forks
- 933
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 17
Description
### Product
axe-core
### Product Version
4.10.0
### Latest Version
- [X] I have tested the issue with the latest version of the product
### Issue Description
#### Expectation
label-content-name-mismatch should not compare the content of the switch component with the aria-labelledby text.
#### Actual
label-content-name-mismatch is comparing the contents of the switch component with the aria-labelledby text.
#### How to Reproduce
The following code will produce the violation - "Ensure that elements labelled through their content must have their visible text as part of their accessible name"
Notifications
[On]
Off
Notifications
[On]
Off
`
#### Additional context
The text contained in the switch is value text of sorts even if the real value is controlled by the aria-checked. it's not a label so it shouldn't be compared for purposes of 2.5.3 Label in Name
Contributor guide
Assessment
This issue has not been assessed yet.