Label click for input element (accessibility)
See original GitHub issueI’ve noticed that the input form element label is not clickable. This means that its not possible to click on the label to focus on the input element. Is this something that was omitted or something I missed?
I know the current workaround is to provide my own htmlFor element like this but I would prefer that the Form.Input would work like this out of the box.
<Form.Field>
<label htmlFor="password">Password</label>
<input
id="password"
name="password"
type="password"
/>
</Form.Field>
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Labeling Controls | Web Accessibility Initiative (WAI) - W3C
A label and a form control should be associated with each other either implicitly or explicitly. Web browsers provide the label as a...
Read more >5 Ways to Make Labels Accessible for Input Controls - Medium
4. Use an Aria-label Attribute ... Use the aria-label attribute to give the hidden label some text like you would a traditional label....
Read more >Web Accessibility Criteria - Input Field Labels
The labels associated with the input elements are spoken by the screen readers when the fields receive focus and users with impaired motor...
Read more >The Label element - HTML: HyperText Markup Language | MDN
When a user clicks or touches/taps a label, the browser passes the focus to its associated input (the resulting event is also raised...
Read more >Form <input> elements must have labels | Axe Rules
Why it Matters. Effective form labels are required to make forms accessible. · Rule Description. Each form element must have a programmatically associated...
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
We are building an accessible site and also need the id on the input to match to the label for attribute. It would be nice if the id was passed to the input itself instead of the div containing it.
Hi guys,
I would like to fix this bug as my first contribution here. I’m thinking of adding a new prop “ID” to Form.Input Shorthand to use as ID in input and as htmlFor in Label. Does anyone object or have better idea?