-
Notifications
You must be signed in to change notification settings - Fork 841
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
[EuiContextMenu] Tabbing regressions #1101
Comments
If possible we should also add tests to guard against future regressions. |
So the good news at least is the up/down stuff still works as intended. I have no idea how that PR you linked would have changed this behavior, very odd. My general read on this stuff (I've been dealing with something similar in SuperSelect, which uses menuitem) is that a lot of these lists within menus probably shouldn't be actual button tags, but utilize either role="listbox" or role="menu" and behave closer to select tags (where tab isn't tied so directly to the elements, but to the overall form). These kinds of systems are really tough to get right on screenreaders, and its very much compounded by the fact that our popover system portals these elements in (versus simply display: hide in the dom). A lot of the aria patterns just don't really account for that kind of stuff beyond aria live. For example, a listbox in a popover should be tied to the button that makes it appear. But if the listbox doesnt exist yet (because of a portal), then it isnt' read correctly. I don't have great solutions here, know this isn't exactly related, just providing some background. Building accessibility in the world of a dynamic dom is challenging. |
I agree that the context menu should trap focus in some way, and Dave's observation about using up/down vs. tab sounds like a good intuition on these menus as well. A more generic catch-all fallback that we may want to consider is having the popover watch for the focus leaving itself and the visually-surrounding elements (e.g. anchor), programmatically inserting itself in the tab order. I don't feel it's a big enough problem to put in that effort, but it is an option. |
Just leaving some notes here for investigation:
Related to #731 |
Original tab behavior
Originally, all of the items within a context menu behaved as if they were part of the tab order of the UI which triggers the menu. You could use the tab key to tab through them and beyond the menu throughout the rest of the surrounding UI.
Regressions
Two regressions have been introduced:
git bisect
, this regression was introduced in Fix context menu focus jumping #1018, though from a cursory glance of the code I'm not sure what could be causing this.Solution
I think it's OK if we don't go back to the original behavior and instead do something different. I think intercepting the tab event and wrapping focus back to the beginning of the elements within the menu would be great UX, which is also how the popover behaves.
The text was updated successfully, but these errors were encountered: