mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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.
This commit is contained in:
committed by
Jeremy Elbourn
parent
4f5b9c546e
commit
b967712399
@@ -140,6 +140,9 @@ md-sidenav {
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
overflow-y: auto; // TODO(kara): revisit scrolling behavior for sidenavs
|
||||
|
||||
// Prevents unnecessary repaints while scrolling.
|
||||
transform: translateZ(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user