Skip to content

Commit c93103b

Browse files
crisbetojelbourn
authored andcommitted
fix: avoid layout jumping on elements with ripples in RTL (#10026)
A while ago we added a `backface-visibility` to some components that have scrollable content in order to avoid repaints while scrolling (see #7889, #7721, #7719, #6890, #2156) which worked at the time, however in the more recent versions of Chrome it causes the content in RTL mode to shift whenever a child has a transform that is being animated (in our case it's usually ripples). These changes revert the `backface-visibility` in order to avoid the jumping, until we can find a better solution. Relates to #10023.
1 parent 7d81b6f commit c93103b

File tree

4 files changed

+0
-11
lines changed

4 files changed

+0
-11
lines changed

src/lib/core/style/_menu-common.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ $mat-menu-icon-margin: 16px !default;
1717
@mixin mat-menu-base($default-elevation) {
1818
@include mat-overridable-elevation($default-elevation);
1919

20-
// Prevents the content from repainting on scroll.
21-
@include backface-visibility(hidden);
22-
2320
min-width: $mat-menu-overlay-min-width;
2421
max-width: $mat-menu-overlay-max-width;
2522
overflow: auto;

src/lib/dialog/dialog.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ $mat-dialog-button-margin: 8px !default;
3434
max-height: $mat-dialog-max-height;
3535
overflow: auto;
3636
-webkit-overflow-scrolling: touch;
37-
38-
// Promote the content to a new GPU layer to avoid repaints on scroll.
39-
@include backface-visibility(hidden);
4037
}
4138

4239
.mat-dialog-title {

src/lib/sidenav/drawer.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ $mat-drawer-over-drawer-z-index: 4;
8080
}
8181

8282
.mat-drawer-content {
83-
// `backface-visibility` prevents the element from repainting on scroll. This is the
84-
// equivalent of using `translateZ(0)`, but it doesn't create a new stacking context.
85-
@include backface-visibility(hidden);
8683
@include mat-drawer-stacking-context($mat-drawer-content-z-index);
8784

8885
display: block;

src/lib/tabs/tab-body.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
@import '../core/style/vendor-prefixes';
22

33
.mat-tab-body-content {
4-
// Avoids repainting while scrolling.
5-
@include backface-visibility(hidden);
64
height: 100%;
75
overflow: auto;
86

0 commit comments

Comments
 (0)