Is there a way to make the backdrop of mat-dialog clickable when the close is on disable?

Viewed 564

I have developed a mat-dialog that only closes when I click on the close button that means it is set to disabled. I would like to have input in the background when my dialog is open. How can this be enabled?

Code:

// Important snippet from dialog component
constructor(
    public dialogRef: MatDialogRef<KagListComponent>) {
    dialogRef.disableClose = true;
  }
// Important snippet from app component
/**
   * Open the dialog
   */
  openDialog(): void {
    const dialogRef = this.dialog.open(DialogComponent, {
      width: '600px',
      backdropClass: 'transparent'
    });
    dialogRef.afterClosed().subscribe(result => {
      console.log(`Dialog will be closed!`, result);
    });
  }

I tried to activate the background with hasBackDrop= true in the function. Unfortunately it did not work. Do you have any idea how I can solve this problem?

0 Answers
Related