google / google/material-design-lite
Text Field does not support implicit label association
- Dominant language
- HTML
- Stars
- 32.2k
- Forks
- 4.9k
- PR merge metrics
- No merged PRs in 30d
Description
The HTML spec allows for an implicit association between a `label` and an `input` by making the `input` a descendant of the `label`. This avoids the need for an associating `for` attribute, which can be problematic when generating dynamic markup because element identifiers must be unique across the entire page. Using an implicit association avoids the need for `id` or `for` attributes altogether. You can work around this by generating a unique identifier when generating the markup - but that's a little inconvenient.
So instead of:
``` html
Text...
```
It would be convenient to be able to do this:
``` html
Text...
```
http://www.w3.org/TR/html5/forms.html#the-label-element
The MDL textfield does not appear to support this arrangement.
Contributor guide
Assessment
This issue has not been assessed yet.