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
fix(cdk/table): ensure CdkTable updates view with OnPush and trackBy (angular#31451)
When CdkTable is used with OnPush change detection and a `trackBy` function,
changes to the `dataSource` might not trigger a view update if the `trackBy`
function indicates that the rows themselves haven't changed (even if their
internal data has). This can leave the data-bound elements within the
table rows displaying outdated information.
This commit adds `markForCheck()` calls within the `_renderRows` method
of `CdkTable`. These calls ensure that when the table's data is updated
(even without full row re-creation due to `trackBy`), the component is
explicitly marked for change detection. This triggers a re-evaluation
of the bindings for all visible rows, ensuring the view remains
consistent with the underlying data.
Fixesangular#24483
0 commit comments