From c23da0c69cd40f1f70a59789a6e4e56c0511cc86 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Tue, 19 May 2026 09:24:20 +0200 Subject: [PATCH] fix(material/sidenav): handle mixed sidenav and drawer Fixes that if we mix something like `mat-drawer-container` and `mat-sidenav`, the navigation ends up in the wrong slot and gets caught by the `inert` attribute when it's opened. --- goldens/material/sidenav/index.api.md | 4 ++-- src/material/sidenav/drawer-container.html | 8 +++----- src/material/sidenav/sidenav-container.html | 8 +++----- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/goldens/material/sidenav/index.api.md b/goldens/material/sidenav/index.api.md index ae94567df92f..357faed9425b 100644 --- a/goldens/material/sidenav/index.api.md +++ b/goldens/material/sidenav/index.api.md @@ -112,7 +112,7 @@ export class MatDrawerContainer implements AfterContentInit, DoCheck, OnDestroy // (undocumented) _userContent: MatDrawerContent; // (undocumented) - static ɵcmp: i0.ɵɵComponentDeclaration; + static ɵcmp: i0.ɵɵComponentDeclaration; // (undocumented) static ɵfac: i0.ɵɵFactoryDeclaration; } @@ -159,7 +159,7 @@ export class MatSidenavContainer extends MatDrawerContainer { // (undocumented) _content: MatSidenavContent; // (undocumented) - static ɵcmp: i0.ɵɵComponentDeclaration; + static ɵcmp: i0.ɵɵComponentDeclaration; // (undocumented) static ɵfac: i0.ɵɵFactoryDeclaration; } diff --git a/src/material/sidenav/drawer-container.html b/src/material/sidenav/drawer-container.html index 24659075c82a..193284095fec 100644 --- a/src/material/sidenav/drawer-container.html +++ b/src/material/sidenav/drawer-container.html @@ -3,13 +3,11 @@ [class.mat-drawer-shown]="_isShowingBackdrop()"> } - - - - + + @if (!_content) { - + } diff --git a/src/material/sidenav/sidenav-container.html b/src/material/sidenav/sidenav-container.html index dcb4e6c3e2c3..a6ce93472723 100644 --- a/src/material/sidenav/sidenav-container.html +++ b/src/material/sidenav/sidenav-container.html @@ -3,13 +3,11 @@ [class.mat-drawer-shown]="_isShowingBackdrop()"> } - - - - + + @if (!_content) { - + }