Skip to content

Commit

Permalink
fix(platform): clear table rows on data source changes (#11019) (#11021)
Browse files Browse the repository at this point in the history
  • Loading branch information
g-cheishvili authored Nov 28, 2023
1 parent ccd89fa commit 12bf2e4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libs/platform/src/lib/table/table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,15 @@ export class TableComponent<T = any>

/** @hidden */
private _listenToTableRowsPipe(): void {
this._subscriptions.add(
/*
* Reset table when the data source is changed,
* because new data source can have different set of data
*/
this._dataSourceDirective.dataSourceChanged.subscribe(() => {
this._setTableRows([]);
})
);
this._subscriptions.add(
this._dataSourceDirective.items$
.pipe(
Expand Down

0 comments on commit 12bf2e4

Please sign in to comment.