FromControl label should have "for" attribute
See original GitHub issueDescribe the bug FromControl label should have “for” attribute, so when user click on the label, the input gets automaticaly focused.
To Reproduce Steps to reproduce the behavior:
- Create simple
formControl
withlabel
andinputField
. - Click on the label.
- Nothing happens.
Expected behavior
Cursor will appear inside the inputField
(or, in case of chackbox, the checbox is toggled)
Additional context
Or, you can nest the <input
>inside
<label>` to get the same behaviour.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
Using label elements to associate text labels with form controls
A label is attached to a specific form control through the use of the for attribute. The value of the for attribute must...
Read more >The Label element - HTML: HyperText Markup Language | MDN
The value of the for attribute must be a single id for a labelable form-related element in the same document as the <label>...
Read more >Form controls must have labels
The preferred technique for labeling form controls is by reference: First, include an id attribute on the form control to be labeled; then...
Read more >Form <input> elements should have a visible label | Axe Rules
The aria-label attribute allows you to add a label directly to pretty much any HTML element, including form elements, paragraphs, tables, and more....
Read more >Should labels ALWAYS have 'for' attribute? - CSS-Tricks
It's always a good idea to give a label a 'for' attribute and link it to the control's ID. Like un-traq-ed said, you...
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
Good catch - we will repair this soon, as we are working on some improvements for the formControl concept currently. So I will integrate this issue when solving #440 issue.
storeOf
factory also needs the default IDuniqueId()
!