fix(drawer): backdrop not transitioning on close (#6651)

This commit is contained in:
Kristiyan Kostadinov
2017-10-03 20:53:29 +02:00
committed by Kara
parent 0875b858d0
commit 80310a5cf7
5 changed files with 19 additions and 24 deletions
-16
View File
@@ -1,16 +0,0 @@
// Separate transitions to be able to disable them in unit tests by omitting this file.
@import '../core/style/variables';
.mat-drawer-transition {
.mat-drawer-content {
transition: {
duration: $swift-ease-out-duration;
timing-function: $swift-ease-out-timing-function;
property: margin-left, margin-right;
}
}
.mat-drawer-backdrop.mat-drawer-shown {
transition: background-color $swift-ease-out-duration $swift-ease-out-timing-function;
}
}
+16
View File
@@ -65,6 +65,14 @@ $mat-drawer-over-drawer-z-index: 4;
visibility: visible;
}
.mat-drawer-transition & {
transition: {
duration: $swift-ease-out-duration;
timing-function: $swift-ease-out-timing-function;
property: background-color, visibility;
}
}
@include cdk-high-contrast {
opacity: 0.5;
}
@@ -76,6 +84,14 @@ $mat-drawer-over-drawer-z-index: 4;
display: block;
height: 100%;
overflow: auto;
.mat-drawer-transition & {
transition: {
duration: $swift-ease-out-duration;
timing-function: $swift-ease-out-timing-function;
property: transform, margin-left, margin-right;
}
}
}
.mat-drawer {
+1
View File
@@ -36,6 +36,7 @@ describe('MatDrawer', () => {
let drawer = fixture.debugElement.query(By.directive(MatDrawer));
let drawerBackdropElement = fixture.debugElement.query(By.css('.mat-drawer-backdrop'));
drawerBackdropElement.nativeElement.style.transition = 'none';
fixture.debugElement.query(By.css('.open')).nativeElement.click();
fixture.detectChanges();
+1 -4
View File
@@ -355,10 +355,7 @@ export class MatDrawer implements AfterContentInit, OnDestroy {
moduleId: module.id,
selector: 'mat-drawer-container',
templateUrl: 'drawer-container.html',
styleUrls: [
'drawer.css',
'drawer-transitions.css',
],
styleUrls: ['drawer.css'],
host: {
'class': 'mat-drawer-container',
},
+1 -4
View File
@@ -109,10 +109,7 @@ export class MatSidenav extends MatDrawer {
moduleId: module.id,
selector: 'mat-sidenav-container',
templateUrl: 'sidenav-container.html',
styleUrls: [
'drawer.css',
'drawer-transitions.css',
],
styleUrls: ['drawer.css'],
host: {
'class': 'mat-drawer-container mat-sidenav-container',
},