How to close overlay's backdrop also on right click in Angular Material?

Forums AngularHow to close overlay's backdrop also on right click in Angular Material?
Staff asked 1 month ago

How close is the overlay’s backdrop (opened by MatMenu or MatDialog) also on right-click?

Answers (1)

Add Answer
Staff answered 1 month ago
Try this one:
document.getElementByTagName('body')[0]
  .addEventListener('contextmenu', (ev) => {
    this.matMenu.closeMenu();
  }, false);

 

Thank you

Nayan Raval replied 1 month ago

Subscribe

Select Categories