Editorial question116K views3,492 votes0 answers1,156 following
AI-generatedMatTable retains page index after data-source swap
When a MatTable's DataSource is replaced after initial rendering, the component retains the previous page index rather than resetting to the first page. This can result in empty or missing rows if the new data set has a different size or structure. The MatTableDataSource implementation manages pagination client-side by maintaining an internal slice, while se