Using mat-menu as context menu: How to close opened mat-menu, and open it in another location
Just add hasBackdrop=false
as in <mat-menu ... [hasBackdrop]="false">
.
What happens is that when the menu is opened after I right click, an invisible backdrop overlay appears covering the entire page. No matter what I try to right click again, the contextmenu event won't trigger and hence onTriggerContextMenu()
does not get called. By setting hasBackgrop
to false, this overlay will not appear.