janiskelemen / formvuelar

Vue form components with server-side validation in mind
https://janiskelemen.github.io/formvuelar/
MIT License
300 stars 25 forks source link

Connect label to form element with `id`. #12

Closed smeranda closed 2 years ago

smeranda commented 4 years ago

This is helpful for accessibility, screen readers and user interaction. The select component already has this modification, so bringing the rest up to this level for consistency.

janiskelemen commented 4 years ago

Good point. The only issue I see is that you would need to make the id field required for all components. Right now the ID field is optional and it would be nice to keep it like that. My suggestion is to generate a unique id if no id is provided as a prop.