question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

false negative "Form elements do not have associated labels"

See original GitHub issue

I have custom input type number in my form, I also use eslint-plugin-a11y. This is my html, which gives false negative on #date-year input/label pairs in lighthouse

<label class="_1DlQ3 _3R713" for="date-year">
  Year
  <div class="_1T1WW _21GYC">
    <button aria-label="minus" class="_37Bh1">
      <div class="_3CR_3 _3REq5 M9WNo">
        <svg viewBox="0 0 16 16">
          <path fill="currentColor" d="M0,7c16,0,16,0,16,0l0,0v2H0"></path>
        </svg>
      </div>
    </button>

    <input type="number" aria-live="polite" aria-atomic="true" id="date-year" class="_2I5TO _3bdCp _3waAi _3rENR" value="2018" min="2017" max="2020" step="1">
 
    <button aria-label="plus" class="_3qHF4">
      <div class="_3CR_3 _3REq5 M9WNo">
        <svg viewBox="0 0 16 16">
          <path fill="currentColor" d="M16,7c0,0-0.007,0-7,0V0H7v7C5.096,7,2.797,7,0,7v2h7v7h2V9h7V7z"></path>
        </svg>
      </div>
    </button>
  </div>
</label>

This is the link, you can see there is custom date-picker with 5 elements of this kind of inputs. https://www.taximow.com/en/transfer/train-from/

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
tekbassecommented, May 2, 2018

@JustFly1984 Try wrapping the LABEL tag around the INPUT tag, or replacing LABEL with a FIELDSET and embedded LEGEND tag. There may be a conflict in wrapping a label around BUTTON and INPUT tags --a browser may have focus issues. I had a similar issue that was resolved when I substituted FIELDSET/LEGEND in place of LABEL.

0reactions
JustFly1984commented, Apr 20, 2018

That is really weird, cos I host my website on netlify.com CDN, which in turn based on AWS. I already had complains about access to my website from Luxembourg ISP which is also weird. Can you please describe your location? I need to investigate, why does my website is unaccessible in some countries.

BTW Paul, I love your youtube videos, Thank you a lot! PS. Can you try to visit my website from VPN or something?

2018-04-20 13:09 GMT+08:00 Paul Irish notifications@github.com:

dunno, here’s what i see

[image: image] https://user-images.githubusercontent.com/39191/39031565-df5901ca-441d-11e8-9949-1827042ef79c.png

this points to DNS resolving differently everywhere… [image: image] https://user-images.githubusercontent.com/39191/39031634-4d2e3e9a-441e-11e8-8d97-dc7cb2524c98.png

weird.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GoogleChrome/lighthouse/issues/4993#issuecomment-382978326, or mute the thread https://github.com/notifications/unsubscribe-auth/ACJseSfchloBWaxVCIoTQEwCp1VK7WXQks5tqW2NgaJpZM4TbW9B .

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Form elements do not have associated labels" (but they ...
I think lighthouse is complaining because your label tag doesn't have any content, it is missing the actual label text. Adjusting the markup...
Read more >
Form elements do not have associated labels
The fields do not have labels because you leave empty the “Field Label” attributes in the fields' settings. The preferred solution would be...
Read more >
Accessibility rule: Form elements should have a visible label
The labels provided by the title and aria-describedby attributes are insufficient to create a real label that can be inferred programmatically from the...
Read more >
Using label elements to associate text labels with form ...
The objective of this technique is to use the label element to explicitly associate a form control with a label. A label is...
Read more >
<input>: The Input (Form Input) element - HTML
A Boolean attribute which, if present, indicates that the user should not be able to interact with the input. Disabled inputs are typically ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found