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

[Bug]: Incorrect use of label for attribute in search input label #23463

Closed
plumpNation opened this issue Jul 15, 2023 · 0 comments · Fixed by #23464
Closed

[Bug]: Incorrect use of label for attribute in search input label #23463

plumpNation opened this issue Jul 15, 2023 · 0 comments · Fixed by #23464

Comments

@plumpNation
Copy link
Contributor

Describe the bug

An HTML validity error detected in Chrome showed that the configuration for the label props was ignoring the fact that the search input id is hardcoded, while the label for attribute is provided by dropshift. They should match.

To Reproduce

Open storybook in Chrome.

Open "Issues" in the dev tools.

Note the error Incorrect use of <label for=FORM_ELEMENT>

The label's for attribute doesn't match any element id. This might prevent the browser from correctly autofilling the form and accessibility tools from working correctly.
To fix this issue, make sure the label's for attribute references the correct id of a form field.

System

Environment Info:

  System:
    OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Binaries:
    Node: 16.18.0 - ~/.nvm/versions/node/v16.18.0/bin/node
    Yarn: 3.5.1 - ~/.yarn/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v16.18.0/bin/npm
  Browsers:
    Chrome: 114.0.5735.198

Additional context

The label is not visible to non screenreader users. It uses the -10000px position absolute technique to be rendered off the page.
It's not a large bug, most users won't be affected at all. But, I believe it's an accessibility issue.

plumpNation pushed a commit to plumpNation/storybook that referenced this issue Jul 15, 2023
…js#23463)

The for attribute value was not set to match the hardcoded value
used for the search input id.
@plumpNation plumpNation changed the title [Bug]: Incorrect use of label for attribute in search input label. [Bug]: Incorrect use of label for attribute in search input label (fixes #23463) Jul 15, 2023
@plumpNation plumpNation changed the title [Bug]: Incorrect use of label for attribute in search input label (fixes #23463) [Bug]: Incorrect use of label for attribute in search input label Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant