In my app I have a case where we have a menu with sub menu and in that sub menu there are 3 items. Once a user click on one of them a Modal with save and cancel buttons pops up. My question is what would be the best practice here - should I close the bellow menus? keep them open and focus to them when modal is closed? other solution?
Thanks!
When closing a modal dialog, focus should go back to the triggering element in most cases.
When a dialog closes, focus returns to the element that invoked the dialog unless either: […]
Which means the menu should stay open, especially when closed by means of Escape or the Cancel button.
If the use case has another logical next step in the task flow, confirming the dialog with Save might close the menu and focus somewhere that makes more sense for the flow.
Since all content outside the dialog needs to be inert and hidden from assistive technology (and visually), it’s no concern if the menu stays open or not.