Can screen reader read the expanded/collapsed state of an input element with role ‘combobox’?

106 Views Asked by At

I know with aria-expanded screen reader should be reading the expanded states. But does anyone know if it’s possible with <input role=“combobox”>?

I tried a couple of variations but the only one that read the expanded states is with role listbox.

Heres a simple stackblitz to show what I mean https://stackblitz.com/edit/js-jxzyqr?file=index.html

2

There are 2 best solutions below

2
Hit Gojiya On

Yes, screen readers can typically read the expanded/collapsed state of an input element with the role combobox when proper aria attributes , such as aria-expanded, are used in the web page or application.

0
Patrick Demers On

The collapsed/expanded state of a combobox is read when you use the aria-expanded on an input with the combobox role.

  • aria-expanded=false when the list of values is collapsed
  • aria-expanded=true when the list of values is expanded

Visit the ARIA Authoring Practices Guide (APG) to find examples of different types of comboboxes.