-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataTable with Virtual Scroll still flickers #4029
Comments
I think that jumping and flickering are not very precise descriptions. For me the bug works in one of two ways: 1) When I scroll slowly over the end of the first page, the next page gets loaded, then (immediately) the next page, then (immediately) the next one, until the last. And then it stops. Or 2) after I scroll slowly over the end of the first page, the second gets loaded, then the first one, then the second one and so on forever. |
Thx filip for your addition. Please everyone who adds a comment ensure that you use the new PrimeNg version 4.2.1 with the 3377 bugfix. |
In my case, under Chrome, it 'works' when the data is loaded slowly (i.e. from request to the server). But: Tested with PrimeNg version 4.2.1, Angular 4.2.6 and Chrome 61.0.3163.100 (Ubuntu) |
Same issue here... :-/ After some investigations, it might be a bug inside the onBodyScroll function inside ScrollableView. But, I think that this line rethrow another scroll event, isn't it ? Source file : datatable.ts:378 |
Some more details... I've added a log inside In FireFox, I get values like these : scrollBody.scrollTop: 423, scrollTable.style.top: 0
scrollBody.scrollTop: 648, scrollTable.style.top: 380 // Pagination occurs
scrollBody.scrollTop: 650, scrollTable.style.top: 380 As you can see, the scrollTop value continues to grow just as expected. In Chrome, for the same dataTable, I get these : scrollBody.scrollTop: 329, scrollTable.style.top: 0
scrollBody.scrollTop: 363, scrollTable.style.top: 0
scrollBody.scrollTop: 168, scrollTable.style.top: 360 // Pagination occurs
// Start looping... :-(
scrollBody.scrollTop: 272, scrollTable.style.top: 0
scrollBody.scrollTop: 632, scrollTable.style.top: 0
scrollBody.scrollTop: 272, scrollTable.style.top: 360
scrollBody.scrollTop: 632, scrollTable.style.top: 0
scrollBody.scrollTop: 272, scrollTable.style.top: 360 For some reason, the scrollTop value goes from '363' to '168'. I would have expected it to be something like '640' just as in FireFox... Sadly, Google wasn't my friend for this one. |
Created a plunker which displays one of the scrolling issues that I've encountered (using primeng version 4.2.1): https://embed.plnkr.co/R9Trajo3iZYjKXg2fBH9/ |
After further investigation, I was able to reproduce another issue. If the rowTrackBy function is used, the table jumps when scrolling with the scroll bar buttons: |
I believe this is caused by Scroll Anchoring, enabled from Chrome 56 onwards. Setting |
@jdp80 great find regarding Scroll Anchoring. I'm currently working around the issue with old data being visible by templating the cell content: All of my data rows have an absolute index that I'm also using as the data key. |
@jdp80 awesome ! :-) I've added this css rule and it works on Chrome now .ui-datatable-scrollable-body {
overflow-anchor: none;
} @machfalcon I'll also try your workaround later. Nice job everyone ! |
@jdp80 solution works , thanks |
Same here. Using the table with virtual scroll and ~1000 rows, it's still flickering and jumping. I recorded a video to show the effect. After a while (and some mouse wheels), the grid seems to jump indefinitely from one position to another in a infinite loop: Version: 4.2.1
The css solution .ui-datatable-scrollable-body {overflow-anchor: none;} not work for me. |
I've also realized the weird behavior, tried another go, works much smoother now. Would be great if you guys can take it for a test run in upcoming 4.3.0.RC1. |
@cagataycivici Did tried with latest version. Working much better than before only in Chrome. Somehow the scrolling in EDGE / Firefox is not loading new set of records anymore. And it ha frozen the view with whitespace after the end of loading of some 40 records. |
@cagataycivici Awesome, it's almost perfect ! Like @mani301 said, I see some whitespace on scroll (on IE11). I.E. : I thing #2950 issue is duplicate |
Adding next css helps the flickering of the table; I had this problem because I am using flex height for my page. Beside this issue the header always moves a little when you scroll fast. I have seen this on the PrimeNG sample site too. |
Thank you very much! This workaround is what I needed. |
This issue still persists when scrollHeight = "flex" and virtualScroll = "true" when scrolled to end |
Same for me, would love to get a solution |
It looks like the flick happens because the actual item size is bigger than the one specified as |
@amirdelfan Thanks, its working for me after spend long time |
[X] bug report
This is a continuation of ticket
https://github.com/primefaces/primeng/issues/3377
because it is closed, but the bug isn't completely fixed yet.
Current behavior
When using the table with virtual scroll, if you scroll down the table with mousewheel and scroll slowly, it's still flickering and jumping. So much so that you feel the content is not loaded properly.
Expected behavior
Load the data to the table without flickering and jumping.
Minimal reproduction of the problem with instructions
See #3377
What is the motivation / use case for changing the behavior?
After the bugfix 3377 it works much better:
The scrollbar size is calculated right, the content is loaded correctly, the last element can be reached and it stops at the last element, but it needs an improvement: When you scroll with mousewheel and scroll slowly, it's still flickering and jumping. So much so that you feel the content is not loaded properly.
Please tell us about your environment:
The text was updated successfully, but these errors were encountered: