Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(material/sort): programatically setting sort-header active/direction does not update UI #22092

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(material/sort): programatically setting sort-header active/direct…
…ion does not update UI
Pavel Marozau committed Mar 3, 2021
commit 1901d78b93757c6ce735e0bbb0b49a2d47bba892
7 changes: 7 additions & 0 deletions src/material/sort/sort-header.ts
Original file line number Diff line number Diff line change
@@ -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.toState !== 'active') {
this._disableViewStateAnimation = false;
this._setAnimationTransitionState(
{fromState: this._viewState.toState, toState: 'active'});
}
}

// If this header was recently active and now no longer sorted, animate away the arrow.