@@ -46,16 +46,7 @@ import {
46
46
ViewEncapsulation ,
47
47
} from '@angular/core' ;
48
48
import { fromEvent , merge , Observable , Subject } from 'rxjs' ;
49
- import {
50
- debounceTime ,
51
- distinctUntilChanged ,
52
- filter ,
53
- map ,
54
- mapTo ,
55
- startWith ,
56
- take ,
57
- takeUntil ,
58
- } from 'rxjs/operators' ;
49
+ import { debounceTime , filter , map , mapTo , startWith , take , takeUntil } from 'rxjs/operators' ;
59
50
import { matDrawerAnimations } from './drawer-animations' ;
60
51
61
52
/**
@@ -367,24 +358,16 @@ export class MatDrawer implements AfterViewInit, AfterContentChecked, OnDestroy
367
358
) ;
368
359
} ) ;
369
360
370
- // We need a Subject with distinctUntilChanged, because the `done` event
371
- // fires twice on some browsers. See https://github.com/angular/angular/issues/24084
372
- this . _animationEnd
373
- . pipe (
374
- distinctUntilChanged ( ( x , y ) => {
375
- return x . fromState === y . fromState && x . toState === y . toState ;
376
- } ) ,
377
- )
378
- . subscribe ( ( event : AnimationEvent ) => {
379
- const { fromState, toState} = event ;
361
+ this . _animationEnd . subscribe ( ( event : AnimationEvent ) => {
362
+ const { fromState, toState} = event ;
380
363
381
- if (
382
- ( toState . indexOf ( 'open' ) === 0 && fromState === 'void' ) ||
383
- ( toState === 'void' && fromState . indexOf ( 'open' ) === 0 )
384
- ) {
385
- this . openedChange . emit ( this . _opened ) ;
386
- }
387
- } ) ;
364
+ if (
365
+ ( toState . indexOf ( 'open' ) === 0 && fromState === 'void' ) ||
366
+ ( toState === 'void' && fromState . indexOf ( 'open' ) === 0 )
367
+ ) {
368
+ this . openedChange . emit ( this . _opened ) ;
369
+ }
370
+ } ) ;
388
371
}
389
372
390
373
/**
0 commit comments