mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(drawer): backdrop not transitioning on close (#6651)
This commit is contained in:
committed by
Kara
parent
0875b858d0
commit
80310a5cf7
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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',
|
||||
},
|
||||
|
||||
@@ -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',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user