digdir / designsystemet

Designsystemet
https://designsystemet.no
MIT License
74 stars 37 forks source link

Navigation with arrow keys in DropdownMenu #1688

Open hansenalexander opened 6 months ago

hansenalexander commented 6 months ago

Description of the bug

Currently testing an implementation of DropdownMenu in our application. JAWS (2023) suggests that I can use arrow up/down to navigate the menu, which does not work. Experiencing the same behavior in the documentation.

Steps To Reproduce

  1. Try navigating any of the dropdown menus using JAWS.

Additional Information

No response

mimarz commented 6 months ago

Thanks for reporting this!

We'll have a look into this to make sure JAWS interprets the component correctly. Which is guess is due to use of role="menu".

We intentionally did not include up/down arrow navigation for now as its quite debatable as to wether a menu should support arrowkeys or not, based on usage. If its an overflow menu or not etc. i don't remember all the specific but I remember we did a lot of research at the time and were back and forth on this before ending up with not supporting up/down arrow keys at this moment.

Barsnes commented 6 months ago

Hi, as @mimarz mentioned above, we decided to not have arrow key navigation. This was mostly because the buttons and links are added next in the taborder, and we felt that was more natural, combined with the point made about the debate about dropdownmenus and navigation.

We will have a look into making JAWS interpet this correctly, but if you have any good points to why arrow keys should be used, feel free to start a discussion!