Confusion with require-input-label
See original GitHub issueI have the following template code that triggered the require-input-label
lint:
<div class="search-input">
<label class="visually-hidden" for="search-input">Search</label>
<input
id="search-input"
type="search"
placeholder="Search deprecations"
autocomplete="off"
aria-label="Search"
{{on "input" (perform this.searchService.search value="target.value")}}
>
</div>
I was a bit confused as I have label
and an aria-label
, and wasn’t sure how to address it.
I ended up removing aria-label
at the suggestion of someone in Discord.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Understanding Success Criterion 3.3.2 - W3C
When label elements are associated with input elements the label is spoken by screen readers when the field receives focus and users with...
Read more >Indicating form controls as required using asterisks (*) - ADG
Asterisk (*) next to a form control's label usually indicates it as "required". ... In the following example, the required input field is...
Read more >HTML Inputs and Labels: A Love Story | CSS-Tricks
In this post, I want to focus on situations where the lack of a semantic label and input combination makes it much harder...
Read more >The Anatomy of Accessible Forms: Required Form Fields
How to indicate a required field · Provide the required text in the label. · Provide a graphic * image in the label...
Read more ><form> Confusion - HTML - Codecademy Forums
<input id="animal-1" name="animal-1" type="text" required>``` ... The for attribute is usually used to associate a element such as <label> ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@runspired yeah that would be a bug in that case; it’s perfectly valid to have a nested label/input and an id.
Issue should be resolved with #1994 but please re-open if you still see any issues. Thank you!