primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Component: Table with Scroll Height Flex and Virtual Scroll, ScrollBar flickers at the end

Open nsaini-05 opened this issue 2 years ago • 4 comments

Describe the bug

When virtualScroll is set to true on table and scrollHeight is set to flex. Sometimes when scrolling to end (almost bottom) the table flickers and scrollbar thumb goes moves in weird position.

Also rows don't get populated when div is stretched as it should with scroll height flex

Environment

Forked from Flex Scroll Demo from Official Site

Reproducer

https://stackblitz.com/edit/emzgbf?file=src%2Fapp%2Fdemo%2Ftable-flexible-scroll-demo.html,src%2Fapp%2Fdemo%2Ftable-flexible-scroll-demo.scss,src%2Fstyles.scss

Angular version

16.2

PrimeNG version

16.7

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

NA

Browser(s)

Chrome

Steps to reproduce the behavior

Resize the Div

Move scrollbar to bottom

Expected behavior

is should not flick

nsaini-05 avatar Nov 05 '23 21:11 nsaini-05

I think that the component dispatch multiple time event (onChange) when it's created.

certifirm avatar Nov 06 '23 16:11 certifirm

I've got the same issue and would love to get any tips on how to resolve it :D

Gykonik avatar Nov 07 '23 09:11 Gykonik

You can solve the scrolling issue by setting the virtual scroll item size to the height of your rows in pixels. In your example above: [virtualScrollItemSize]="46"

The flickering of the headers should go away if you set the column widths to a fixed value manually.

bountyface avatar Jan 03 '24 14:01 bountyface

Virtual scrolling & lazy loading never worked good. I've been trying it since v11, and it's a gamble every time. Each version has something that fails, except maybe v13 with caveats. Not even the example in the documentation works, and the page that shows this precise integration has disappeared too. I've been opening an issue a while ago with perfect reproducibility and it was left unnoticed, no matter how many had the same issue. I'm even trying the LTS versions, which are supposed to be stable, and they have problems as well.

john8329 avatar Aug 17 '24 20:08 john8329

Virtual scrolling & lazy loading never worked good. I've been trying it since v11, and it's a gamble every time. Each version has something that fails, except maybe v13 with caveats. Not even the example in the documentation works, and the page that shows this precise integration has disappeared too. I've been opening an issue a while ago with perfect reproducibility and it was left unnoticed, no matter how many had the same issue. I'm even trying the LTS versions, which are supposed to be stable, and they have problems as well.

Yep it's kind of sad how scrolling can be so messed up. Using a fixed virtaulScrollItemSize also doesnt work once table rows heights vary more than 5px.

Virtual Scroll also exists in multiple components so i've seen dropdowns, multi-selects, etc all plagued by same issues.

mkutowski avatar Dec 19 '24 11:12 mkutowski

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation and try the latest PrimeNG version(v19). If there is no improvement on this, can you open a new issue so we can include it in our roadmap?

Thanks a lot for your understanding! Best Regards,

mertsincan avatar Dec 25 '24 13:12 mertsincan