Skip to content

Commit

Permalink
perf(dialog): avoid repaintin dialog content element on scroll
Browse files Browse the repository at this point in the history
Fixes the `<md-dialog-content>` element being repainted on scroll.

Fixes angular#6878.
  • Loading branch information
crisbeto committed Sep 7, 2017
1 parent bef6271 commit 4e605e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/core/style/_vendor-prefixes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@
cursor: -webkit-grabbing;
cursor: grabbing;
}

@mixin backface-visibility($value) {
-webkit-backface-visibility: $value;
backface-visibility: $value;
}
/* stylelint-enable */
4 changes: 4 additions & 0 deletions src/lib/dialog/dialog.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import '../core/style/elevation';
@import '../core/style/vendor-prefixes';
@import '../core/a11y/a11y';


Expand Down Expand Up @@ -35,6 +36,9 @@ $mat-dialog-button-margin: 8px !default;
max-height: $mat-dialog-max-height;
overflow: auto;
-webkit-overflow-scrolling: touch;

// Promote the content to a new GPU layer to avoid repaints on scroll.
@include backface-visibility(hidden);
}

.mat-dialog-title {
Expand Down

0 comments on commit 4e605e9

Please sign in to comment.