-
Notifications
You must be signed in to change notification settings - Fork 779
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
Browser extension: axe is ignoring hidden labels for input fields even when it should acknowledge them #1176
Comments
Same issue at https://wikimediafoundation.org/ on element |
Right, clipping does seem to be the problem. Even if you use large values like |
Interestingly, that's the exact same bug I reported at almost the same time as you. #1177. I'll close that one as a duplicate. |
… 0px in all directions Instead of marking all clipped labels as hidden, we're now checking their values as well Closes issue: dequelabs#1176
Have submitted a PR for this. Please let me know if I've missed something as per project guidelines, I'll happily fix it |
* fix: consider element's accessible names when labels are hidden Closes #1176 * chore: revert condition for pr review * chore: update to use `isVisble` sr mode
Any idea when this fix will be available in the stable versions of the Chrome & Firefox extensions? We've a defect open on our system that has a dependency on this. 😓 |
This is still an issue, Using Lighthouse v4 shows elements using the CSS in the initial report as "Form element has explicit that is hidden" Using Lighthouse v 3.2.0 (which uses axe-core 3.0.0 beta) correctly identifies the labels. Any idea on a resolution time for this? |
This still appears to be happening in axe Chrome extension v3.7.0. The .sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
} |
There are common instances where we often require labels of input fields to be hidden (e.g. Search box because it already has a search icon in it).
As per this W3C article, the recommended way to achieve this is to add the below CSS code to the label:
But even after implementing this, aXe still throws an error for the field saying
Form elements must have labels
.Here is a working demo of the same: https://jsfiddle.net/xk2vaq6f/1/embedded/result
The text was updated successfully, but these errors were encountered: