I have built a MegaMenu based on How to build a full-width mega-menu using Material-UI?
For accessibility reasons it should be possible to tab through links in the menu and select one of the links with the ENTER
key.
However, the MUI Menu always automatically closes whenever the TAB
key is pressed.
Here’s a minimal version of my Menu: https://codesandbox.io/p/sandbox/dazzling-farrell-9sv3fy?file=%2Fsrc%2FMegaMenu.tsx
What surprises me is that automatically closing the menu on TAB
key seems to be the default behaviour of the MUI menu. Check the default examples on https://mui.com/material-ui/react-menu/#basic-menu which also closes on tab
.
So I wonder what would be the best approach to creating a accessible MegaMenu? That is, one that can be navigated with the Tab
key.