ibm-js / delite

HTML Custom Element / Widget infrastructure
http://ibm-js.github.io/delite/
Other
68 stars 28 forks source link

FormWidget: automatically set id on <input> to be referenced from <label> nodes #448

Closed wkeese closed 8 years ago

wkeese commented 8 years ago

For accessibility reasons, the label associated with a form widget should probably point to the widget's focus node rather than the widget's root node. So support markup like this:

<label for="my-checkbox-input">My Checkbox:</label>
<d-checkbox id="my-checkbox"></d-checkbox>

In other words, make the FormWidget code automatically assign an id to the nested <input> node based on the widget's id (if it's defined).

My only confusion is what happens when there are multiple focus nodes.