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

The button-name markup rule throws false positive for label + for with id #4625

Closed
1 task done
emmayjiang opened this issue Oct 23, 2024 · 1 comment
Closed
1 task done
Labels
ungroomed Ticket needs a maintainer to prioritize and label

Comments

@emmayjiang
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

The following should pass the button-name rule:

<label for="my-button">Label</label>
<button id="my-button"></button>

The real-world use case for this is using a button with the role of a combobox.

Actual

The code fails the button-name rule.

How to Reproduce

https://jsfiddle.net/nvagwdhe/

Additional context

This is where the HTML spec defines a button as an element that can be labelled via a label: https://html.spec.whatwg.org/multipage/forms.html#category-label

@emmayjiang emmayjiang added the ungroomed Ticket needs a maintainer to prioritize and label label Oct 23, 2024
@straker
Copy link
Contributor

straker commented Oct 24, 2024

Thanks for the issue. This should now be resolved in v4.10.1. Could you update to latest and see if it works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ungroomed Ticket needs a maintainer to prioritize and label
Projects
None yet
Development

No branches or pull requests

2 participants