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

label-content-name-mismatch in ARIA switch compares value text with name #4561

Open
1 task done
Tracked by #4562
curtbellew opened this issue Aug 15, 2024 · 1 comment
Open
1 task done
Tracked by #4562
Labels
fix Bug fixes rules Issue or false result from an axe-core rule
Milestone

Comments

@curtbellew
Copy link

Product

axe-core

Product Version

4.10.0

Latest Version

  • 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"

<label id="theswitch">Notifications</label>
<div aria-labelledby="theswitch" role="switch" aria-checked="true" tabindex="0" >
    <span>[On]</span>
    <span >Off</span>
</div>

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
@curtbellew curtbellew added the ungroomed Ticket needs a maintainer to prioritize and label label Aug 15, 2024
@straker
Copy link
Contributor

straker commented Aug 22, 2024

Thanks for the issue.

@straker straker 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 Aug 22, 2024
@straker straker added this to the Axe-core 4.11 milestone Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes rules Issue or false result from an axe-core rule
Projects
None yet
Development

No branches or pull requests

2 participants