Skip to content

fix: Flicker when scrolling virtualizer in and out of view#9902

Merged
devongovett merged 1 commit intomainfrom
fix-virtualizer-flicker
Apr 10, 2026
Merged

fix: Flicker when scrolling virtualizer in and out of view#9902
devongovett merged 1 commit intomainfrom
fix-virtualizer-flicker

Conversation

@devongovett
Copy link
Copy Markdown
Member

Noticed on staging docs that if you scroll past the List layout example and then back up, some of the items flicker in and out of view. This is due to a logic error in ListLayout. We adjust the visible rectangle to try to keep the number of visible rows consistent by rounding the y position and height. But when we adjust the y position, we also need to add the adjusted difference to the height to ensure the rectangle still covers the originally requested region.

Also noticed that scrollview was continuously emitting updates for virtualizer that were entirely out of view, so I've prevented that as well (should be just an optimization).

Test instructions

Open the PR build for virtualizer docs. Scroll past the list layout example and back up and down a few times and verify that there is no flickering.

@rspbot
Copy link
Copy Markdown

rspbot commented Apr 9, 2026

@devongovett devongovett added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit 2dd5f96 Apr 10, 2026
29 checks passed
@devongovett devongovett deleted the fix-virtualizer-flicker branch April 10, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants