0

I want that it is not possible to click outside a dialog (nothing should happens).

I tried the followings that do not works for me:

let dialogRef = this.dialog.open(DialogComponent, {
   disableClose: true
});

or

this.dialogRef.disableClose = true
this.dialogRef.backdropClick().subscribe(_ => {
  this.dialogRef.close();
})

But when i click outside the opened dialog the main window reatcs.

Anybody know how I can solve it?

Peter
  • 87
  • 1
  • 6
  • 1
    Does this answer your question? [Disable click outside of angular material dialog area to close the dialog (With Angular Version 4.0+)](https://stackoverflow.com/questions/46772852/disable-click-outside-of-angular-material-dialog-area-to-close-the-dialog-with) – Maher Sep 01 '22 at 10:22

1 Answers1

0

Thx. I added

let dialogRef = this.dialog.open(TrackDialogComponent, {
  hasBackdrop: true,
});
Eugene
  • 1,242
  • 1
  • 10
  • 15
Peter
  • 87
  • 1
  • 6