danott / react-rails-form-helpers

Components for composing forms targeted at Rails
MIT License
81 stars 18 forks source link

Click on labels focus corresponding inputs #12

Closed babgyy closed 6 years ago

babgyy commented 6 years ago

Currently, when clicking a label, nothing happens. Ideally, clicking a label should focus (or activate for checkboxes) the input. This is done by having the for attribute of the label matching the id attribute of the input. Rails does that with an all_namespace_snake_cased convention, which is implemented here.

This commit does that, and updates the sample output in the README.

Potential issues / incompatibilities with client configuration if commit is merged after upgrade :

babgyy commented 6 years ago

I pushed a new commit with your suggestions !

danott commented 6 years ago

Released as 0.1.0-beta.16