Skip to content

[igx-drop-down] Uses incorrect role attribute for navigational component #15840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jamesuhl opened this issue May 21, 2025 · 0 comments · May be fixed by #15912
Open

[igx-drop-down] Uses incorrect role attribute for navigational component #15840

jamesuhl opened this issue May 21, 2025 · 0 comments · May be fixed by #15912
Assignees
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.

Comments

@jamesuhl
Copy link

Description

Screen readers are trying to interpret the dropdown component as a form element even when used as a navigational component.

  • browser: all

Steps to reproduce

  1. Go to the demo code on Infragistics web page here: https://www.infragistics.com/products/ignite-ui-angular/angular/components/drop-down#multi-level-drop-down-menu (Note: the top examples on the page are correct, the bottom examples are using the same component code for navigation, which is not correct)
  2. Analyze the code using dev tools

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”
Image

Image

@jamesuhl jamesuhl added 🐛 bug Any issue that describes a bug 🆕 status: new labels May 21, 2025
@ChronosSF ChronosSF assigned kacheshmarova and unassigned Lipata May 29, 2025
@kdinev kdinev added the ♿ a11y When the issue or PR is related to accessibility label May 29, 2025
@MonikaKirkova MonikaKirkova added 🛠️ status: in-development Issues and PRs with active development on them and removed 🆕 status: new labels Jun 5, 2025
@MonikaKirkova MonikaKirkova linked a pull request Jun 6, 2025 that will close this issue
14 tasks
@MonikaKirkova MonikaKirkova added ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. and removed 🛠️ status: in-development Issues and PRs with active development on them labels Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants