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

Improve aria attributes of README example #142

Open
tmaier opened this issue Aug 7, 2023 · 0 comments
Open

Improve aria attributes of README example #142

tmaier opened this issue Aug 7, 2023 · 0 comments

Comments

@tmaier
Copy link

tmaier commented Aug 7, 2023

I quickly checked https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Combobox_Role and I think the following aria attributes can be easily added:

<div data-controller="autocomplete" data-autocomplete-url-value="/birds/search" role="combobox">
  <input type="text" data-autocomplete-target="input" aria-autocomplete="list" aria-controls="bird-id-results" />
  <input type="hidden" name="bird_id" data-autocomplete-target="hidden"/>
  <ul class="list-group" data-autocomplete-target="results" id="bird-id-results"></ul>
</div>
  • Add aria-autocomplete="list" to the input field
  • Add aria-controls="bird-id-results" (id of the <ul>) to the input field
  • Add id="bird-id-results" to the <ul>.
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

No branches or pull requests

1 participant