Skip to content
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

Flickering on reverse when items have wide range of sizes #261

Closed
mattwondra opened this issue Nov 29, 2023 · 6 comments
Closed

Flickering on reverse when items have wide range of sizes #261

mattwondra opened this issue Nov 29, 2023 · 6 comments
Assignees

Comments

@mattwondra
Copy link

Describe the bug
When there's a lot of variation in item sizes, there can be excessive flickering when items first render. For example, in VList reverse mode, when a very tall row scrolls into view and mounts for the first time, there's often a flickering at the bottom of the viewable area.

I have a reduced test case in mattwondra:virtua:bug/flickering-when-item-heights-vary, here's a demo:

Screen.Recording.2023-11-29.at.12.00.19.PM.mov

To Reproduce

Expected behavior

  • The viewable content should not flicker
  • (It's OK for the scrollbar to change size and jump a bit, I know that's probably not avoidable)

Platform:

  • OS: MacOS
  • Browser: Chrome, Firefox, & Safari (tested all three)
  • Version of react: 18.2.0
  • Version of this package: 17.2.0
@inokawa
Copy link
Owner

inokawa commented Nov 30, 2023

A patch was released in 0.17.3.

It will fix the issue in Chrome and Firefox, but still exists in Safari.
In my investigation, Safari seems to have different timing to dispatch updated scroll event when we update scrollTop/scrollLeft imperatively.

@mattwondra
Copy link
Author

Thank you @inokawa! I started testing this, but unfortunately hit a regression. I've logged it here: #270

@inokawa
Copy link
Owner

inokawa commented Nov 30, 2023

Oh...I'll check it.
Thank you!

@inokawa
Copy link
Owner

inokawa commented Jan 12, 2024

https://bugs.webkit.org/show_bug.cgi?id=75015 probably not related

@inokawa
Copy link
Owner

inokawa commented Feb 4, 2024

As far as I researched, Safari seems to have 2 tricky behavior (maybe a kind of bug?):

  1. Imperative scrollTop update during scrolling sometimes delays. For example, setting scrollTop += 1000 will usually affect the next scroll event, however sometimes not next but after the next in Safari.
  2. Imperative scrollTop update during scrolling sometimes delays browser's paint. That means updated items range may not be painted immediately and can cause blank.

@inokawa
Copy link
Owner

inokawa commented Feb 4, 2024

Closing because the remained task is Safari specific, and it will be tracked in another issue.

@inokawa inokawa closed this as completed Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants