-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Open
Labels
AccessibilityThis issue is related to accessibility (a11y)This issue is related to accessibility (a11y)GThis is is related to a Google internal issueThis is is related to a Google internal issueP3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/dialogarea: material/menu
Description
If you trigger a dialog from a mat-menu-item
's click handler, the focused item is the mat-menu-item itself. This gets saved in _elementFocusedBeforeDialogWasOpened
. But that element is gone from the DOM when the dialog is closed, so focus is restored to the body.
It would be cool if the dialog could somehow keep track of the fact that it was a transient menu item that was focused, and focus ought to go back to the menu's trigger instead.
Waiting a tick before opening the dialog fixes it, because the menu itself focuses the trigger before the dialog opens, so it gets the right element ref.
Metadata
Metadata
Assignees
Labels
AccessibilityThis issue is related to accessibility (a11y)This issue is related to accessibility (a11y)GThis is is related to a Google internal issueThis is is related to a Google internal issueP3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/dialogarea: material/menu