Skip to content

Commit b967712

Browse files
crisbetojelbourn
authored andcommitted
perf(sidenav): avoid extra repaints while scrolling (#2156)
Avoids repaints while scrolling inside of a sidenav. This isn't an issue on desktop browsers, but can potentially be on mobile. This can be checked by going to the dev tools > console fold-out menu > Rendering > Scrolling Performance Issues.
1 parent 4f5b9c5 commit b967712

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib/sidenav/sidenav.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ md-sidenav {
140140
box-sizing: border-box;
141141
height: 100%;
142142
overflow-y: auto; // TODO(kara): revisit scrolling behavior for sidenavs
143+
144+
// Prevents unnecessary repaints while scrolling.
145+
transform: translateZ(0);
143146
}
144147
}
145148

0 commit comments

Comments
 (0)