File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/material/autocomplete Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -268,7 +268,16 @@ export abstract class _MatAutocompleteTriggerBase
268
268
269
269
if ( this . panelOpen ) {
270
270
// Only emit if the panel was visible.
271
- this . autocomplete . closed . emit ( ) ;
271
+ // The `NgZone.onStable` always emits outside of the Angular zone,
272
+ // so all the subscriptions from `_subscribeToClosingActions()` are also outside of the Angular zone.
273
+ // We should manually run in Angular zone to update UI after panel closing.
274
+ if ( NgZone . isInAngularZone ( ) ) {
275
+ this . autocomplete . closed . emit ( ) ;
276
+ } else {
277
+ this . _zone . run ( ( ) => {
278
+ this . autocomplete . closed . emit ( ) ;
279
+ } ) ;
280
+ }
272
281
}
273
282
274
283
this . autocomplete . _isOpen = this . _overlayAttached = false ;
You can’t perform that action at this time.
0 commit comments