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

Autocomplete uses fixed ids which could cause issues with multiple autocompletes on a page. #378

Closed
spacedmonkey opened this issue Sep 27, 2019 · 1 comment · Fixed by #379

Comments

@spacedmonkey
Copy link

The element assistiveHint has two issues.

  1. Why does it have a fixed id? Does means you can't have autocompletes in one page.
  2. Why is display: 'none' used here? Should it use something like this
/* Text meant only for screen readers. */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

Props WordPress.org.

@NickColley
Copy link
Contributor

NickColley commented Sep 27, 2019

Hey @spacedmonkey ,

  1. That's a very good point, while the most common use case we'd only expect one autocomplete on a page there's certainly people that need to do this. We should investigate making sure this id is unique. That said I think it may still work in practice, even if the markup is not great, since all instances of an autocomplete would need the same message.

  2. We can use display: none here without issue since this text is read about by the association with aria-describedby.

I'll update this issue to reflect the issue with the id, thanks for helping out.

@NickColley NickColley changed the title assistiveHint Autocompltee assistiveHint uses fixed a id which is incorrect with multiple autocompletes in a page. Sep 27, 2019
@NickColley NickColley changed the title Autocompltee assistiveHint uses fixed a id which is incorrect with multiple autocompletes in a page. Autocomplete uses fixed ids which could cause issues with multiple autocompletes on a page. Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants