angularangular-materialmat-sidenavmat-slider

Angular material mat-sidenav-content click event issue


When I put click event on mat-sidenav-content <mat-sidenav-content (click)="isNavBarOpened=false"> The mat-slide-toggle inside is not working.

Here is the example


Solution

  • Add $event.stopPropagation() on your mat-slide toggle component so that event will not get bubbled up.

    <mat-slide-toggle (click)="$event.stopPropagation()"></mat-slide-toggle>
    

    Forked Example