digipolisantwerp / antwerp-ui_angular

Antwerp UI is a component interface library for building user interfaces and responsive web apps.
https://digipolisantwerp.github.io/antwerp-ui_angular
MIT License
13 stars 19 forks source link

Accessibility issue in "Forms → Autocomplete" (focus management) #224

Open roelvangils opened 3 years ago

roelvangils commented 3 years ago

Describe the bug

When you build a JavaScript component, you need to manage focus for both keyboard users and screen reader (AT) users.

Note: this issue is blocking.

How to fix

Add aria-expanded to the <input>, instead of a using <div> that doesn't get focused. What doesn't get focused is usually not announced by AT.

We prefer using the technique that inolves using element.focus and tabindex.

More information: Element.focus vs aria-activedescendant | Zell Liew