77 */
88
99import {
10+ ANIMATION_MODULE_TYPE ,
1011 AfterContentInit ,
1112 ChangeDetectionStrategy ,
1213 ChangeDetectorRef ,
@@ -25,7 +26,6 @@ import {
2526 booleanAttribute ,
2627 inject ,
2728} from '@angular/core' ;
28- import { AnimationEvent } from '@angular/animations' ;
2929import {
3030 MAT_OPTGROUP ,
3131 MAT_OPTION_PARENT_COMPONENT ,
@@ -35,7 +35,6 @@ import {
3535} from '@angular/material/core' ;
3636import { _IdGenerator , ActiveDescendantKeyManager } from '@angular/cdk/a11y' ;
3737import { Platform } from '@angular/cdk/platform' ;
38- import { panelAnimation } from './animations' ;
3938import { Subscription } from 'rxjs' ;
4039
4140/** Event object that is emitted when an autocomplete option is selected. */
@@ -109,18 +108,15 @@ export function MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY(): MatAutocompleteDefau
109108 'class' : 'mat-mdc-autocomplete' ,
110109 } ,
111110 providers : [ { provide : MAT_OPTION_PARENT_COMPONENT , useExisting : MatAutocomplete } ] ,
112- animations : [ panelAnimation ] ,
113111} )
114112export class MatAutocomplete implements AfterContentInit , OnDestroy {
115113 private _changeDetectorRef = inject ( ChangeDetectorRef ) ;
116114 private _elementRef = inject < ElementRef < HTMLElement > > ( ElementRef ) ;
117115 protected _defaults = inject < MatAutocompleteDefaultOptions > ( MAT_AUTOCOMPLETE_DEFAULT_OPTIONS ) ;
118-
116+ protected _animationsDisabled =
117+ inject ( ANIMATION_MODULE_TYPE , { optional : true } ) === 'NoopAnimations' ;
119118 private _activeOptionChanges = Subscription . EMPTY ;
120119
121- /** Emits when the panel animation is done. Null if the panel doesn't animate. */
122- _animationDone = new EventEmitter < AnimationEvent > ( ) ;
123-
124120 /** Manages active item in option list based on key events. */
125121 _keyManager : ActiveDescendantKeyManager < MatOption > ;
126122
@@ -282,7 +278,6 @@ export class MatAutocomplete implements AfterContentInit, OnDestroy {
282278 ngOnDestroy ( ) {
283279 this . _keyManager ?. destroy ( ) ;
284280 this . _activeOptionChanges . unsubscribe ( ) ;
285- this . _animationDone . complete ( ) ;
286281 }
287282
288283 /**
0 commit comments