Skip to content

Comments

fix(material/menu): render backdrop for context menu if explicitly opted in#32845

Open
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:32350/context-menu-backdrop
Open

fix(material/menu): render backdrop for context menu if explicitly opted in#32845
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:32350/context-menu-backdrop

Conversation

@crisbeto
Copy link
Member

When we introduced context menus, we disabled backdrops on them in order to mimic the native behavior where right clicking somewhere else moves the menu there. This seems to not be desirable for some users so these changes add some logic to enable the backdrop if the user explicitly requested it.

Fixes #32350.

…ted in

When we introduced context menus, we disabled backdrops on them in order to mimic the native behavior where right clicking somewhere else moves the menu there. This seems to not be desirable for some users so these changes add some logic to enable the backdrop if the user explicitly requested it.

Fixes angular#32350.
@crisbeto crisbeto added the target: rc This PR is targeted for the next release-candidate label Feb 24, 2026
@pullapprove pullapprove bot requested review from andrewseguin and ok7sai February 24, 2026 08:40
menu.hasBackdrop == null ? !this._triggersSubmenu() : menu.hasBackdrop;
} else {
overlayConfig.hasBackdrop = false;
overlayConfig.hasBackdrop = menu.hasBackdrop == null ? false : menu.hasBackdrop;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overlayConfig.hasBackdrop = menu.hasBackdrop ?? false might be easier to read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: material/menu target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(MatMenu): Opening as context menu ignores hasBackdrop

2 participants