petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.23k stars 300 forks source link

[BUG] Align to bottom flickering #423

Closed pranas closed 3 years ago

pranas commented 3 years ago

Describe the bug The items in the list start to flicker when using alignToBottom option and browser zoom feature. When you use browser zoom feature it creates items with floating point height which likely triggers this issue. The item size keeps recalculating and changing which triggers different padding at the top which results in flickering effect.

Reproduction You can reproduce in "align-to-bottom" e2e example with the following patch: https://github.com/EddyTravels/react-virtuoso/commit/90ee4ea73c3b54779912c9058e9002cbefd93e99

To Reproduce Steps to reproduce the behavior:

  1. Open "align-to-bottom"
  2. Adjust browser zoom level down to 75%
  3. The flickering should start

Screenshots

https://user-images.githubusercontent.com/91422/128022776-7abc8767-a9fa-447e-9320-9a8af824bf0e.mov

(I recorded with item height at 30.8 but I was later able to reproduce with 30px height items as well at different zoom level)

Desktop (please complete the following information):

Additional context

I believe this was also the issue in #317 and #268 but was closed due to lack of reproduction example.

petyosi commented 3 years ago

Thanks, this seems like a clear repro. Hopefully fixable.

PerlMonker303 commented 3 years ago

Encountered the same issue on a closed-source project, but not only when scrolling to the bottom of the list. Noticed one thing though: the more you scrolled (i.e. the further you are in the list), the more aggressive the flickering is. Hope this helps a bit.

pranas commented 3 years ago

@petyosi This is an important issue for us so we've made a contribution to help you prioritize it. Hope you can crack it soon!

petyosi commented 3 years ago

@pranas Thank you very much, I appreciate that - the test case is helpful as well. I will look into it as soon as my schedule allows.

petyosi commented 3 years ago

@pranas The fix I discovered seems correct to me and addresses the simplistic case you presented. Please let me know how the new version behaves in your real project.

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 1.10.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

pranas commented 3 years ago

It seems the flickering is gone, great find! Thanks for a quick fix and keep up the good work with react-virtuoso.

tsnevillecom commented 1 year ago

How do you align these to the bottom?