Skip to content

fix(material/menu): do not pull focus out of an overlay opened by a menu item - #33989

Closed
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/menu-restore-focus-after-dialog
Closed

MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/menu-restore-focus-after-dialog

Conversation

@MeAkib

@MeAkib MeAkib commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

When a menu item opens an overlay, like a dialog, that focuses its content before the menu closes (e.g. when animations are disabled), the menu would restore focus to its trigger behind the overlay. These changes skip restoring focus when the menu is closed by a click and focus has moved into a different overlay. Focus is still restored if it's in another menu (e.g. when clicking an item in a sub-menu), in the overlay containing the trigger, or outside of any overlay.

Fixes #33967.

…enu item

When a menu item opens an overlay, like a dialog, that focuses its content before the menu closes (e.g. when animations are disabled), the menu would restore focus to its trigger behind the overlay. These changes skip restoring focus when the menu is closed by a click and focus has moved into a different overlay. Focus is still restored if it's in another menu (e.g. when clicking an item in a sub-menu), in the overlay containing the trigger, or outside of any overlay.

Fixes angular#33967.
@crisbeto

Copy link
Copy Markdown
Member

Handled in #33996.

@crisbeto crisbeto closed this Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(material/menu): menu restores focus to its trigger after a menu item opens a dialog (animations disabled / prefers-reduced-motion)

2 participants