@@ -94,7 +94,7 @@ class MaterialDropdownSelectComponent<T> extends MaterialSelectBase<T>
9494 KeyboardHandlerMixin ,
9595 ActivateItemOnKeyPressMixin <T >,
9696 ShiftClickSelectionMixin <T >
97- implements PopupSizeProvider , OnChanges , OnDestroy {
97+ implements PopupSizeProvider , AfterChanges , OnDestroy {
9898 /// Function for use by NgFor for optionGroup.
9999 ///
100100 /// Avoids recreating the DOM for the optionGroup.
@@ -175,6 +175,14 @@ class MaterialDropdownSelectComponent<T> extends MaterialSelectBase<T>
175175
176176 final ChangeDetectorRef _changeDetector;
177177
178+ bool _disabledChanged = false ;
179+
180+ @override
181+ set disabled (bool value) {
182+ super .disabled = value;
183+ _disabledChanged = true ;
184+ }
185+
178186 MaterialDropdownSelectComponent (
179187 @Optional () IdGenerator idGenerator,
180188 @Optional () @SkipSelf () this ._popupSizeDelegate,
@@ -457,14 +465,15 @@ class MaterialDropdownSelectComponent<T> extends MaterialSelectBase<T>
457465 }
458466
459467 @override
460- ngOnChanges ( Map < String , SimpleChange > changes ) {
461- if (changes. containsKey ( 'disabled' ) && disabled) {
468+ void ngAfterChanges ( ) {
469+ if (_disabledChanged && disabled) {
462470 close ();
463471 }
472+ _disabledChanged = false ;
464473 }
465474
466475 @override
467- ngOnDestroy () {
476+ void ngOnDestroy () {
468477 _optionsListener? .cancel ();
469478 _selectionListener? .cancel ();
470479 }
0 commit comments