Skip to content

Commit

Permalink
fix(drawer): backdrop not transitioning on close (#6651)
Browse files Browse the repository at this point in the history
  • Loading branch information
crisbeto authored and kara committed Oct 3, 2017
1 parent 0875b85 commit 80310a5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 24 deletions.
16 changes: 0 additions & 16 deletions src/lib/sidenav/drawer-transitions.scss

This file was deleted.

16 changes: 16 additions & 0 deletions src/lib/sidenav/drawer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions src/lib/sidenav/drawer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
5 changes: 1 addition & 4 deletions src/lib/sidenav/drawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down
5 changes: 1 addition & 4 deletions src/lib/sidenav/sidenav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down

0 comments on commit 80310a5

Please sign in to comment.