-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Bug: matSortDirection will not work if matSortActive had changed in matSort directive. #12754
Comments
Same issue happens to me. If I programatically change sort: and also have subscribtion to sort: I (sometimes!) receive By the way why I have to set it like "id / start" and get "active / direction"? |
@andrewseguin It looks like the sort header UI only updates when interacted with via user interaction. If the update comes from either a property binding or from a method call it updates the state, but the UI is not reflected. |
I think this is a duplicate of #10242 |
Fix mat-sort-header arrow not displaying after sorting programmatically (eg. `matSort.sort()`) Related to angular#10242, angular#12754
A work-around proposed by @pavelekNET here solved this issue for my, at-least until bug fix will be available.
|
Fix mat-sort-header arrow not displaying after sorting programmatically (eg. `matSort.sort()`) Related to angular#10242, angular#12754
I have tried this on angular 5 and it works -
|
Fix mat-sort-header arrow not displaying after sorting programmatically (eg. `matSort.sort()`) Related to angular#10242, angular#12754
Any progress on this? |
Bug, feature request, or proposal:
Bug!
What is the expected behavior?
In the table element with sort-header - matSort directive - the properties matSortActive and matSortDirection will work independently.
What is the current behavior?
The matSortDirection property will work only if matSortActive didn't changed
What are the steps to reproduce?
Providing a StackBlitz reproduction is the best way to share your issue.
StackBlitz starter:
View and Edit: https://stackblitz.com/edit/angular-41eoff?file=main.ts
View Only: https://angular-41eoff.stackblitz.io
What is the use-case or motivation for changing an existing behavior?
Fixing the bug and providing a current behavior for these 2 properties (matSortActive and matSortDirection).
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
The text was updated successfully, but these errors were encountered: