@@ -334,7 +334,6 @@ export class MdSidenav implements AfterContentInit, OnDestroy {
334
334
] ,
335
335
host : {
336
336
'class' : 'mat-sidenav-container' ,
337
- '[class.mat-sidenav-transition]' : '_enableTransitions' ,
338
337
} ,
339
338
encapsulation : ViewEncapsulation . None ,
340
339
} )
@@ -363,9 +362,6 @@ export class MdSidenavContainer implements AfterContentInit {
363
362
private _left : MdSidenav | null ;
364
363
private _right : MdSidenav | null ;
365
364
366
- /** Whether to enable open/close trantions. */
367
- _enableTransitions = false ;
368
-
369
365
constructor ( @Optional ( ) private _dir : Directionality , private _element : ElementRef ,
370
366
private _renderer : Renderer2 , private _ngZone : NgZone ) {
371
367
// If a `Dir` directive exists up the tree, listen direction changes and update the left/right
@@ -384,8 +380,12 @@ export class MdSidenavContainer implements AfterContentInit {
384
380
} ) ;
385
381
this . _validateDrawers ( ) ;
386
382
387
- // Give the view a chance to render the initial state, then enable transitions.
388
- first . call ( this . _ngZone . onMicrotaskEmpty ) . subscribe ( ( ) => this . _enableTransitions = true ) ;
383
+ // Give the view a chance to render the initial state, then enable transitions. Note that we
384
+ // don't use data binding, because we're not guaranteed that newer version of Angular will
385
+ // re-evaluate them after we set the flag here.
386
+ first . call ( this . _ngZone . onMicrotaskEmpty ) . subscribe ( ( ) => {
387
+ this . _renderer . addClass ( this . _element . nativeElement , 'mat-sidenav-transition' ) ;
388
+ } ) ;
389
389
}
390
390
391
391
/** Calls `open` of both start and end sidenavs */
0 commit comments