7
7
*/
8
8
9
9
import {
10
+ ANIMATION_MODULE_TYPE ,
10
11
AfterContentInit ,
11
12
ChangeDetectionStrategy ,
12
13
ChangeDetectorRef ,
@@ -25,7 +26,6 @@ import {
25
26
booleanAttribute ,
26
27
inject ,
27
28
} from '@angular/core' ;
28
- import { AnimationEvent } from '@angular/animations' ;
29
29
import {
30
30
MAT_OPTGROUP ,
31
31
MAT_OPTION_PARENT_COMPONENT ,
@@ -35,7 +35,6 @@ import {
35
35
} from '@angular/material/core' ;
36
36
import { _IdGenerator , ActiveDescendantKeyManager } from '@angular/cdk/a11y' ;
37
37
import { Platform } from '@angular/cdk/platform' ;
38
- import { panelAnimation } from './animations' ;
39
38
import { Subscription } from 'rxjs' ;
40
39
41
40
/** Event object that is emitted when an autocomplete option is selected. */
@@ -109,18 +108,15 @@ export function MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY(): MatAutocompleteDefau
109
108
'class' : 'mat-mdc-autocomplete' ,
110
109
} ,
111
110
providers : [ { provide : MAT_OPTION_PARENT_COMPONENT , useExisting : MatAutocomplete } ] ,
112
- animations : [ panelAnimation ] ,
113
111
} )
114
112
export class MatAutocomplete implements AfterContentInit , OnDestroy {
115
113
private _changeDetectorRef = inject ( ChangeDetectorRef ) ;
116
114
private _elementRef = inject < ElementRef < HTMLElement > > ( ElementRef ) ;
117
115
protected _defaults = inject < MatAutocompleteDefaultOptions > ( MAT_AUTOCOMPLETE_DEFAULT_OPTIONS ) ;
118
-
116
+ protected _animationsDisabled =
117
+ inject ( ANIMATION_MODULE_TYPE , { optional : true } ) === 'NoopAnimations' ;
119
118
private _activeOptionChanges = Subscription . EMPTY ;
120
119
121
- /** Emits when the panel animation is done. Null if the panel doesn't animate. */
122
- _animationDone = new EventEmitter < AnimationEvent > ( ) ;
123
-
124
120
/** Manages active item in option list based on key events. */
125
121
_keyManager : ActiveDescendantKeyManager < MatOption > ;
126
122
@@ -282,7 +278,6 @@ export class MatAutocomplete implements AfterContentInit, OnDestroy {
282
278
ngOnDestroy ( ) {
283
279
this . _keyManager ?. destroy ( ) ;
284
280
this . _activeOptionChanges . unsubscribe ( ) ;
285
- this . _animationDone . complete ( ) ;
286
281
}
287
282
288
283
/**
0 commit comments