Skip to content

Commit 13d3e21

Browse files
committed
refactor(material/sidenav): adds comments to explain reason for change
Updates previous changes to add the reasoning and reference for the removal of the -1 for side mode sidenavs.
1 parent 4b5161c commit 13d3e21

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/material/sidenav/drawer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ export class MatDrawerContent extends CdkScrollable implements AfterContentInit
165165
// this was also done by the animations module which some internal tests seem to depend on.
166166
// Simulate it by toggling the `hidden` attribute instead.
167167
'[style.visibility]': '(!_container && !opened) ? "hidden" : null',
168+
// The sidenav container should not be focused on when used in side mode. See b/286459024 for
169+
// reference. Updates tabIndex of drawer/container to default to null if in side mode.
168170
'[attr.tabIndex]': '(mode !== "side") ? "-1" : null',
169171
},
170172
changeDetection: ChangeDetectionStrategy.OnPush,

src/material/sidenav/sidenav.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ export class MatSidenavContent extends MatDrawerContent {}
4747
templateUrl: 'drawer.html',
4848
host: {
4949
'class': 'mat-drawer mat-sidenav',
50+
// The sidenav container should not be focused on when used in side mode. See b/286459024 for
51+
// reference. Updates tabIndex of drawer/container to default to null if in side mode.
5052
'[attr.tabIndex]': '(mode !== "side") ? "-1" : null',
5153
// must prevent the browser from aligning text based on value
5254
'[attr.align]': 'null',

0 commit comments

Comments
 (0)