Skip to content

Commit

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

Fixes #6878.
  • Loading branch information
crisbeto authored and mmalerba committed Sep 12, 2017
1 parent 27cbe47 commit 51396d0
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 51396d0

Please sign in to comment.