Open paulGeoghegan opened 1 week ago
@paulGeoghegan I think you accidentally pasted the reproduction from the "range" issue
@KonnorRogers sorry about that. I have fixed it.
@paulGeoghegan There's like 4 main points here so I'll try to keep my findings brief:
1.) Only reading number of items in a group - it appears role="separator"
seems to create implicit menu groups so it will only read the number of elements in the current group, which is unfortunate. So I think thats an example issue , and not anything inherently wrong with the menu itself. Perhaps using role="group"
and wrapping the items may provide a better experience? This would require some testing to see what way reads best.
2.) I notice we're conditionally setting aria-haspopup=""
as a boolean, as opposed to always keeping it with aria-haspopup="menu"
for menuitems that contain submenus. Along the same lines, I noticed aria-expanded
has the same conditional logic as booleans, but it should be aria-expanded="true | false"
. I'll work on filing issues for these as they should provide a more informative experience for screenreaders.
3.) I noticed the APG example here https://www.w3.org/WAI/ARIA/apg/patterns/menubar/examples/menubar-navigation/ reads the proper levels of submenus, so I need to do some accessibility tree inspection to see whats up.
4.) I am noticing if a submenu is open and the ESC key is pressed, it completely eliminates focus. I'll file an issue for that as well.
Thank you so much again for this detailed report!
@KonnorRogers thank you for reading it and caring! I really do hope that I have been helpful.
Describe the bug
A bug is a demonstrable problem caused by code in the library. Please provide a clear and concise description of what the bug is here. Menus seem to function correctly. However, if you try to use the left or right arrows they seem to break unless you are expanding a sub-menu. Screen readers also only announce the amount of items for the section of the menu you are in e.g. if you have a menu with 5 items but a separator after the second item it would seem to a screen reader user that there is only 2 items. This is good but it should be clear that there are more items in the menu. When you have a sub-menu expanded and press escape which I expected to close the sub-menu it also seems to break the menu but you are still focus trapped unless you press escape again. It is also not clear when there is a sub-menu. Perhaps it should say collapsed to indicate to screen readers that they can expand it. It would also be nice if you could give each menu section as in the parts of a menu between separators labels.
To Reproduce
Steps to reproduce the behavior:
Re-focus the menu and now try to navigate using the left or right arrows. Again you are focus trapped in a seemingly empty space.
Browser / OS