question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

useWindowVirtualizer shows a blank area when there are multiple virtualizers on page

See original GitHub issue

Describe the bug

Hello, thanks for your time!

One potential bug: when using multiple useWindowVirtualizers on a single page, I noticed that between each list there is a large blank area and only the last few items are shown on the bottom list.

A quick inspection suggests that the problem is transform: translateY(${virtualRow.start}px) calculation doesn’t reset between each useWindowVirtualizers instance (each list on the page). When I change the value of translateY using the browser inspector and set it to 0 (or any other value based on the row height), the item is positioned correctly.

Your minimal, reproducible example

https://codesandbox.io/s/wispy-fire-boq7ft?file=/src/App.tsx

Steps to reproduce

scroll all the way to the bottom in the sandbox demo

Expected behavior

The virtualized content should be able to handle multiple virtualized lists on the same page.

How often does this bug happen?

No response

Screenshots or Videos

No response

Platform

macOS, Windows.

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:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
piecykcommented, Nov 6, 2022

Hi @flowlyIL

Why does 2600 works? Because it’s the total height of the first list?

Yes, basic it’s the height of elements before the list. I would say better is to read and observe position of the list with ResizeObserver, something like https://codesandbox.io/s/festive-tdd-0mslhl?file=/src/App.tsx

1reaction
piecykcommented, Nov 5, 2022

This would be fixed with https://github.com/TanStack/virtual/pull/409 Current list assumes that it starts from top and there is no other content.

Read more comments on GitHub >

github_iconTop 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 >
The blank area when user is scrolling quickly in cdk-virtual-scroll
cdk-virtual-scroll-viewport, is showing white blank space when scroll quickly. If we use minBufferPx and maxBufferPx to reduce the blank ...
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
useWindowVirtualizer shows a blank area when there are multiple virtualizers on page ... Virtualizer does not update after adjusting row height.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found