How can I keep a material mat-drawer from closing when the user clicks off it?

2.1k views Asked by At

Be default the drawer closes when you click off it but I only want it to close when the user click the cancel or save button in the drawer.

   <mat-drawer #drawer mode="over" position="end" class="edit-drawer" disableClose="false" [opened]="false" closedStart="matDrawerClosedStart($event)">
        <app-vendor-edit *ngIf="selectedVendor" [vendor]="selectedVendor" (save)="saveVendor($event)"
            (cancel)="closeDrawer()" (delete)="deleteVendor($event)">
        </app-vendor-edit>
    </mat-drawer>

1

There are 1 answers

0
punkouter On

You are right. disableClose=true the one that works