diff --git a/src/material/sort/sort-header.ts b/src/material/sort/sort-header.ts index 8b2ab1ded297..8fb709f8568a 100644 --- a/src/material/sort/sort-header.ts +++ b/src/material/sort/sort-header.ts @@ -163,6 +163,13 @@ export class MatSortHeader extends _MatSortHeaderMixinBase .subscribe(() => { if (this._isSorted()) { this._updateArrowDirection(); + // If this header wasn't recently active and now becomes sorted, animate the arrow in. + if (this._viewState && this._viewState.fromState !== 'active' + && this._viewState.toState !== 'active') { + this._disableViewStateAnimation = false; + this._setAnimationTransitionState( + {fromState: this._arrowDirection, toState: 'active'}); + } } // If this header was recently active and now no longer sorted, animate away the arrow.