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

Label "for" and input "id" do not match #490

Closed
joaogarin opened this issue Oct 21, 2021 · 0 comments · Fixed by #491
Closed

Label "for" and input "id" do not match #490

joaogarin opened this issue Oct 21, 2021 · 0 comments · Fixed by #491

Comments

@joaogarin
Copy link
Contributor

Short description

I was trying to add a label that points correctly to the id of the input.

In this issue #450 there is a mention to this PR #464 which implements a id to the input, however the "for" attribute of the label points to the id prop directly and the input has a id of geosuggest__input--${id} https://github.com/ubilabs/react-geosuggest/pull/464/files#diff-c4990fe56ebfd0fcaf879109aa33c1a0002f567e3273ec7255e94934331cbbd6R169 which basically now has the label pointing to the div that wraps the entire autocomplete instead of pointing to the input itself.

Expected results

I expected that by providing an id and a label the label points to the input and not the div above.

Actual results

Instead of '...', what I saw was that '...' happened instead.

Reproduction steps

  1. Provide a id and a label
  2. Check the label for and id of the input and they don't match

Additional Information

This poses an accessibility problem which basically right now its very hard to solve as we don't have access to the internals. the only way is to add the label ourselves.. Also the documentation is wrong here https://github.com/ubilabs/react-geosuggest#label since this is not what happens currently

@plumdumpling plumdumpling linked a pull request Aug 7, 2023 that will close this issue
4 tasks
@yfr yfr closed this as completed in #491 Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant