Skip to content

Commit 810040e

Browse files
committedOct 28, 2024·
fix(material/sidenav): remove IE animation workaround (#29929)
Removes a workaround that's no longer necessary now that we don't support IE. (cherry picked from commit 070be9f)
1 parent a3449dc commit 810040e

File tree

1 file changed

+10
-27
lines changed

1 file changed

+10
-27
lines changed
 

‎src/material/sidenav/drawer.ts

+10-27
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,7 @@ import {
4949
ViewEncapsulation,
5050
} from '@angular/core';
5151
import {fromEvent, merge, Observable, Subject} from 'rxjs';
52-
import {
53-
debounceTime,
54-
distinctUntilChanged,
55-
filter,
56-
map,
57-
mapTo,
58-
startWith,
59-
take,
60-
takeUntil,
61-
} from 'rxjs/operators';
52+
import {debounceTime, filter, map, mapTo, startWith, take, takeUntil} from 'rxjs/operators';
6253
import {matDrawerAnimations} from './drawer-animations';
6354

6455
/**
@@ -367,24 +358,16 @@ export class MatDrawer implements AfterViewInit, AfterContentChecked, OnDestroy
367358
);
368359
});
369360

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;
380363

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+
});
388371
}
389372

390373
/**

0 commit comments

Comments
 (0)
Please sign in to comment.