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

[BUG]: False positive for "The value "foo" of the 'for' attribute is not the 'id' of a valid <input> element" #2068

Closed
irv opened this issue Oct 8, 2024 · 5 comments
Labels
Bug Something isn't working engine Issues in the accessibility-checker-engine component false-positive Rules incorrectly reporting a violation T63 user-reported Issues identified outside of the core team

Comments

@irv
Copy link

irv commented Oct 8, 2024

Project

accessibility-checker-engine

Browser

Chrome, Safari, Firefox

Operating system

MacOS

Description

I guess related to PR #1944

When testing against a select eleemnt, a false positive is displayed for this rule.

But WCAG 2.2 H44 states that this is not just applied to <input> elements, but also <select> and <textarea>

https://www.w3.org/WAI/WCAG22/Techniques/html/H44

Steps to reproduce

<label for="my_select">A Selection</label>
<select id="my_select">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
@MHoov MHoov added Bug Something isn't working engine Issues in the accessibility-checker-engine component false-positive Rules incorrectly reporting a violation user-reported Issues identified outside of the core team labels Oct 8, 2024
@shunguoy
Copy link
Contributor

@irv, I ran your test example, but I don't see the error. Can you please check again or post a test code with the error? Thanx.

@shunguoy shunguoy added the T63 label Oct 14, 2024
@tombrunet
Copy link
Member

It looks like we need to tweak the message because it indicates that it must be an input even though it already does the right thing for other element types. The example that you provide does not trigger the indicated error by itself. Usually this happens because you have the same id on another element that isn't appropriate, so even though you think you'd associated a label to the element you intended, you've actually associated it with some other element that isn't correct.

@shunguoy
Copy link
Contributor

shunguoy commented Oct 14, 2024

The change in the messages and help was made and will be deployed in the Nov. release.d help

@irv
Copy link
Author

irv commented Oct 15, 2024

right, OK. I think in my case it's not that it's a duplicate id, but that the element is hidden in the dom by something

<label for="my_select">A Selection</label>
<select id="my_select" hidden="">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>

So that triggers it, for example. Agree updating the text wouldbe very helpful

@shunguoy
Copy link
Contributor

@irv Yes, your test code triggers the error, but the error message is unclear. The violation message was updated for all the labelable elements, including , , etc. The change will be deployed in the Nov. release. I am going to close the issue.

@philljenkins philljenkins mentioned this issue Nov 5, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working engine Issues in the accessibility-checker-engine component false-positive Rules incorrectly reporting a violation T63 user-reported Issues identified outside of the core team
Projects
None yet
Development

No branches or pull requests

4 participants