Is there a way to return focus to the menu target element once we close the modal with ESC? In this scenario last active element would be the menu item which we clicked but it's difficult to focus that element as the menu is already closed by then. We can just focus the menu target element.
I checked use-focus-return and use-focus-trap but could not seem to figure it out.
I would greatly appreciate your help regarding this matter.