[igx-drop-down] Uses incorrect role attribute for navigational component #15840
Labels
aria-support
🐛 bug
Any issue that describes a bug
dropdown
♿ a11y
When the issue or PR is related to accessibility
✅ status: resolved
Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Description
Screen readers are trying to interpret the dropdown component as a form element even when used as a navigational component.
Steps to reproduce
Result
The code is using the role attributes of "listbox" and "option"
Expected result
The code should be using the role attributes of: 'menu', 'menubar', 'menitems', (for navigational dropdown components)
Details
For custom dropdown components being used as a form element (emulating a
<select>
tag), the listbox and option roles are appropriate. Which is how the Infragistics code currently renders.However, when building a custom dropdown to be used as a navigational device (emulating a
<button>
and a revealed list of hyperlinks) the menubar, menu and menuitem roles are more appropriate.The Infragistics code only uses the listbox and option pattern, which causes NVDA to not function properly if the component is used for navigational purposes.
If hyperlinks or buttons are used inside of the “listbox” dropdown menu, whenever a link is selected using the ENTER key, NVDA shifts to focus to the topmost item in the list. This is the correct behavior for a
<select>
element, which is what the “listbox” role is meant to emulate. This means that when using NVDA, only the topmost hyperlink can be selected.Attachments
In both of the examples (shown below), the Infragistics component is coded as if it were a form element, but the component is used as a navigational device. The role=“listbox” should be a “menu”, and the role=“option” should be set to “menuitem”

The text was updated successfully, but these errors were encountered: