question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

👂 Accessibility for screenreaders

See original GitHub issue

I was testing this component with a screenreader and found a couple issues with the display of the autocomplete suggestions. When listening to the screenreader there is no way to know that a dropdown with suggestions has appeared as you type into the input.

Consider these two fairly simple options.

Option 1: provide a visually-hidden <span> that says to arrow down for autocomplete suggestions

<span class="visually-hidden" id="autocomplete-description">Arrow down for autocomplete suggestions</span>
<div aria-describedby="autocomplete-description" id="PlacesAutocomplete__autocomplete-container ... />

or Option 2: add the aria-live="polite" attribute so the screenreader will automatically start reading the suggestions as you type into the input.

<div aria-live="polite" id="PlacesAutocomplete__autocomplete-container ... >

I have tested both options with a screenreader and both work nicely to add a bit more accessibility to the autocomplete. If you like any of these suggestions I’d be happy to make a PR. 😁

Side note: I also noticed that the input has no <label> which is an accessibility requirement. This one isn’t so much of an issue, as the developer using the component can easily add a <label> and the inputId={...} prop, but could also be solved by including a aria-label attribute by default.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
bvellekcommented, Apr 22, 2017

@kenny-hibino Great! I am going to reach out to the a11y community to make sure I choose the best solution, then I will submit a PR.

0reactions
sambokaicommented, May 17, 2020

@bvellek would you be willing to update the PR? I would review and merge it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accessibility Screen Readers - W3Schools
As the name implies, a screen reader is a tool that reads your screen. Necessary for blind people, important for partially-sighted users and...
Read more >
How to Check Web Accessibility with a ... - ExpandTheRoom
Checking your website's accessibility using a screen reader or a keyboard is not as hard as it sounds! I'll show you how to...
Read more >
10 Free Screen Readers For Blind Or Visually Impaired Users
Free screen readers to assist blind and visually impaired users. ... When it comes to universal access, several people with hearing or visual...
Read more >
What is a screen reader, and why are they important? - TPGi
Screen readers are sophisticated technology. Unlike a “text-to-speech” function on a computer, they have the ability to do more than just read ...
Read more >
Designing for Screen Reader Compatibility - WebAIM
Screen readers are also used by people with certain cognitive or learning disabilities, or users who simply prefer audio content over text.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found