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
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
                        
                            
                        
                        
                            On
                            
                                                    
                    
                Moving the set property value part to a function fixed the issue for me. This way, we need not touch event propagation order.
My guess is moving to function is adding extra CPU cycles and that delay is fixing the issue. But it is just a guess and open for explanations from experts.
<mat-sidenav-content (click)="closeNavBar()">
closeNavBar() {
this.isNavBarOpened=false;
}
                        
Add $event.stopPropagation() on your mat-slide toggle component so that event will not get bubbled up.
Forked Example