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

Form elements do not have associated labels #8839

Closed
Aircl0wn opened this issue May 3, 2019 · 4 comments
Closed

Form elements do not have associated labels #8839

Aircl0wn opened this issue May 3, 2019 · 4 comments

Comments

@Aircl0wn
Copy link

Aircl0wn commented May 3, 2019

Provide the steps to reproduce

  1. Run LH on https://www.veenendaal.nl/
<form action="https://www.veenendaal.nl/nc/algemeen/zoeken/" method="get" class="search-bar-form">
    <label for="searchBar" class="sr-only">Doorzoek de site</label>
    <input type="search" id="searchBar" name="q" class="search-bar-input" value="" placeholder="Zoeken" title="invoerveld zoekopdracht">
    <button type="submit" class="search-bar-button" id="search-bar-button" aria-label="Start met zoeken">
        <span class="search-button-text">Zoeken</span>
    </button>
</form>

What is the current behavior?

Lighthouse (in Chrome and separate extension) returns notification of a missing label for the input field. Axe does not return this notification.

This does not happen if i test the snippet above separately so it's a combination of content on the page that's causing lighthouse to fail. So far i haven't figured out why specifically.

What is the expected behavior?

The input field has a label provided with the for attribute set to the correct id of the input field.

Environment Information

  • Affected Channels: Extension, DevTools tested
  • Lighthouse version: 4.3.1
  • Node.js version: -
  • Operating System: MacOS 10.14.4, Chrome 74.0.3729.131

Related issues

@patrickhulce
Copy link
Collaborator

Thanks for filing! I'm not seeing this on our 5.0 prerelease where we've updated axe, so my guess would be it was a bug in the older version of axe.

image

@brendankenny
Copy link
Member

looks like the fix was in dequelabs/axe-core#1187, released in aXe 3.2.0, landed in Lighthouse in #8370, and, yah, will be in 5.0

@brendankenny
Copy link
Member

looks like the fix was in dequelabs/axe-core#1187,

well, looks like that's actually for the issue in #8435, but the rest of the comment is correct :)

@Aircl0wn
Copy link
Author

Aircl0wn commented May 4, 2019

wonderful, thanks guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants