useWindowVirtualizer shows blank when having other contents on page
See original GitHub issueDescribe the bug
Hello, thanks for open sourcing this great library.
One potential bug: when using useWindowVirtualizer, I noticed the virtualized content would start showing blank items when scrolling down, if the page has some other normal contents on top.
Your minimal, reproducible example
https://codesandbox.io/s/friendly-noether-6f2p8z?file=/src/App.tsx
Steps to reproduce
scroll down on the sandbox demo
Expected behavior
the virtualized content should not blank on the visible window
How often does this bug happen?
No response
Screenshots or Videos
No response
Platform
MacOS
tanstack-virtual version
v3.0.0-beta.18
TypeScript version
No response
Additional context
No response
Terms & Code of Conduct
- I agree to follow this project’s Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:10 (1 by maintainers)
Top Results From Across the Web
React Virtualized - Screen going blank after scrolling a long ...
But I'm facing the below issue. enter image description here. When I try scrolling to the bottom for 2 seconds, it's blank then...
Read more >Virtualize large lists with react-window - web.dev
Since items in a virtualized list only change when the user scrolls, blank space can briefly flash as newer entries are about to...
Read more >TanStack virtual Issues - Giters
Scroll stucks when having fixed overlay with pointer-events: none ... useWindowVirtualizer shows blank when having other contents on page.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yeah, here we need to add something like
scrollMarginthat will handle this cases. @dylanwulf was on right path, internally we need to skip altering scrollToFn when syncing scroll position.I was able to fix the scrolling methods by providing a custom
scrollToFn:but now my problem is that it automatically scrolls to the first element of my list on mount, even if I don’t have
initialOffsetspecified.