File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -201,8 +201,10 @@ export abstract class MatPaginatedTabHeader implements AfterContentChecked, Afte
201
201
// On dir change or window resize, realign the ink bar and update the orientation of
202
202
// the key manager if the direction has changed.
203
203
merge ( dirChange , resize , this . _items . changes ) . pipe ( takeUntil ( this . _destroyed ) ) . subscribe ( ( ) => {
204
- // We need to defer this to give the browser some time to recalculate the element dimensions.
205
- Promise . resolve ( ) . then ( realign ) ;
204
+ // We need to defer this to give the browser some time to recalculate
205
+ // the element dimensions. The call has to be wrapped in `NgZone.run`,
206
+ // because the viewport change handler runs outside of Angular.
207
+ this . _ngZone . run ( ( ) => Promise . resolve ( ) . then ( realign ) ) ;
206
208
this . _keyManager . withHorizontalOrientation ( this . _getLayoutDirection ( ) ) ;
207
209
} ) ;
208
210
You can’t perform that action at this time.
0 commit comments