primeng icon indicating copy to clipboard operation
primeng copied to clipboard

p-table: Table automatically scrolls to top when table item is removed [virtual scroll]

Open srnec opened this issue 1 year ago • 1 comments

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: image

After remove is removed: image

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

  1. open attached stackblitz
  2. scroll in the middle of the table
  3. click remove button on the very right side of the row
  4. 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.

srnec avatar Aug 28 '24 11:08 srnec

related to #12808

srnec avatar Aug 28 '24 11:08 srnec

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:

github-actions[bot] avatar Dec 04 '24 10:12 github-actions[bot]

I am currently facing the same problem and would appreciate a fix or workaround.

gianluca-moro avatar May 02 '25 11:05 gianluca-moro