Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX: Form field markup bug #144

Open
ikbensiep opened this issue Aug 24, 2022 · 1 comment
Open

UX: Form field markup bug #144

ikbensiep opened this issue Aug 24, 2022 · 1 comment
Assignees

Comments

@ikbensiep
Copy link
Contributor

Currently, selecting a form control can only be done by clicking or focusing the form control element itself; focusing the associated <label> element does nothing.
This is particularly annoying for radio and checkbox inputs.

The <label> tags do have for='...' attributes, but the form controls all lack an id='...' attribute.
(they are outfitted with name='...' attributes, but the input needs to have a matching id attribute for it to respond to a click on its <label> element. 😢 )

Suggested solution

add id attribute matching the name attribute on Form controls (<input>, <select>, <textarea> etc)

@ikbensiep ikbensiep self-assigned this Aug 24, 2022
@evert
Copy link
Member

evert commented Aug 24, 2022

Probably a good usecase for useId:

https://reactjs.org/docs/hooks-reference.html#useid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants