PrimeNG DataTable Virtual Scrolling Selection State Loss
0 reputation · 24 Apr 2023, 01:03 UTC
Issue Overview
The PrimeNG DataTable component supports virtual scrolling to handle large data sets efficiently. When selectionMode="multiple" is enabled, the documentation states that selected rows should remain selected even when they scroll out of the visible buffer. However, in practice, the component appears to clear the selection once the virtual scroll buffer changes.
Current Observations
Using PrimeNG 13.5 with Angular 16, selecting rows and scrolling beyond the buffer results in the selection being reset. No console warnings or errors are reported, and the component’s API does not expose a method to preserve selection state across buffer changes.
Unresolved Questions
- Which internal mechanism of PrimeNG’s virtual scrolling causes the loss of selection state when rows scroll out of view?
- Is there an undocumented configuration option or lifecycle hook that can maintain selection across buffer updates?
- Has this behavior been intentionally changed in newer releases, or is it an oversight that requires a dedicated issue?