Search code examples
javascripthtmljqueryjaws-screen-reader

JAWS not reading dropdown list items created using unordered list when using SelectBoxIt js


I have below dropdown list code which is generated using selectboxit js lib. JAWS is not reading the items in select list when focus in on the items. I have tried adding aria-label and title attributes on li, a , span and even i element but its still not reading. What attribute do i need to add so that JAWS can read it properly on focus. Focus is going properly on li element when up and down arrow is used.

<ul id="ddlSubReason_1SelectBoxItOptions" class="selectboxit-options selectboxit-list" tabindex="-1" role="listbox" aria-hidden="true">
   <li id="0" data-val="" data-disabled="false" class="selectboxit-option selectboxit-option-first selectboxit-selected" role="option" aria-label="">
   <a class="selectboxit-option-anchor">
   <span class="selectboxit-option-icon-container">
   <i class="selectboxit-option-icon  selectboxit-container"></i></span></a></li>
   <li id="1" data-val="29" data-disabled="false" class="selectboxit-option" role="option" aria-label="Selection text placeholder 1">
   <a class="selectboxit-option-anchor">
   <span class="selectboxit-option-icon-container">
   <i class="selectboxit-option-icon  selectboxit-container"></i></span>
   Selection text placeholder 1</a></li>
   <li id="2" data-val="28" data-disabled="false" class="selectboxit-option" role="option" aria-label="Selection text placeholder 2">
   <a class="selectboxit-option-anchor">
   <span class="selectboxit-option-icon-container">
   <i class="selectboxit-option-icon  selectboxit-container"></i></span>
   Selection text placeholder 2</a></li>
   <li id="3" data-val="55" data-disabled="false" class="selectboxit-option" role="option" aria-label="Selection text placeholder 3">
   <a class="selectboxit-option-anchor">
   <span class="selectboxit-option-icon-container">
   <i class="selectboxit-option-icon  selectboxit-container"></i></span>
   Selection text placeholder 3</a></li>  
</ul>

Solution

  • Posting the solution that worked for me which i found on this link - https://webaim.org/discussion/mail_thread?thread=6559

    1. Moved tabindex="0" into the surrounding span, since this should handle keyboard interaction.
    2. Added IDs and tabindex="-1" to all elements with role=option.
    3. Added aria-activedescendant to the container with role=combobox, which should be dynamically updated to point to the selected. (I was missing this particular point which fixed the issue for me)