You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mat Sorting on Mat Table calls re-render multiple times #21667
I am not sure this is a bug, but I think it is wrong. I know the mat table change detection strategy is onPush,
and it will re-render when the datasource reference will be changed, but when you are using mat Sorting on that table, it will re-render the table when you will hover that sortable header, it comes from components/src/material/sort/sort-header.ts file there are 2 events added. to the host
changed the title [-]Mat Sorting on Mat Table call re-render multiple times[/-][+]Mat Sorting on Mat Table cals re-render multiple times[/+]on Jan 21, 2021
changed the title [-]Mat Sorting on Mat Table cals re-render multiple times[/-][+]Mat Sorting on Mat Table calls re-render multiple times[/+]on Jan 21, 2021
This is working as expected. What you're seeing is not re-rendering, it's Angular calling your value functions to check if anything changed to determine if something needs to be re-rendered. In general, you shouldn't make any assumptions about when or how many time Angular will read the value of your template bindings.
Activity
[-]Mat Sorting on Mat Table call re-render multiple times[/-][+]Mat Sorting on Mat Table cals re-render multiple times[/+][-]Mat Sorting on Mat Table cals re-render multiple times[/-][+]Mat Sorting on Mat Table calls re-render multiple times[/+]jelbourn commentedon Jan 21, 2021
This is working as expected. What you're seeing is not re-rendering, it's Angular calling your value functions to check if anything changed to determine if something needs to be re-rendered. In general, you shouldn't make any assumptions about when or how many time Angular will read the value of your template bindings.
angular-automatic-lock-bot commentedon Feb 21, 2021
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.