What fresh hell is THIS now? - Patrick Lauke
Hey guys, im developing a keyboard accessible main menu script - the main menu can have simple drop downs or mega menu drop downs.
For desktop the main menu will be horizontal and on mobile it will be vertical.
I have a desktop version of the script working correctly as per the interactions described here https://www.w3.org/TR/wai-aria-practices/#menu.
What im looking for is some advice for handling the keyboard interactions when the main menu is in a mobile viewport (https://codepen.io/cbracco/full/kvbgz).
When your in the top level menu on mobile because the menu is vertical the up and down arrows moves the focus to the prev and next item. Space, enter, left and right open the sub menu and shift the focus to the first item in the sub menu. This is as per the keyboard interactions.
What im not clear on for mobile is the interaction when in the sub menu. On desktop using the left and right key, the interaction is to close the current sub menu. Move focus to next top level menu item. Open the sub menu of the next top level menu item with focus.
Would it be advisable to keep that interaction on mobile?
Hopefully this makes sense.