p-table: Table automatically scrolls to top when table item is removed [virtual scroll]
Describe the bug
When item/row is removed from the table that uses virtual scrolling then table scrolls to the top.
Before row is removed:
After remove is removed:
Notice that table scroll position is suddenly on the top.
This issue is not happening when table without virtual scroll is used.
Environment
Local environment
Reproducer
https://stackblitz.com/edit/n34vgd?file=src%2Fapp%2Ftable-vertical-scroll-demo.html
Angular version
18.0.2
PrimeNG version
17.18.9
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.20.2
Browser(s)
Chrome 127.0.6533.120
Steps to reproduce the behavior
- open attached stackblitz
- scroll in the middle of the table
- click remove button on the very right side of the row
- notice table scrolls to the top after row/item is removed
Expected behavior
When table with virtual scrolling feature is used, table should not scroll to the top automatically when row is removed from the table.
related to #12808
Due to PrimeNG team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. :sparkles: Thank you for your contribution! :sparkles:
I am currently facing the same problem and would appreciate a fix or workaround.