petyosi / react-virtuoso

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

Display: none issue #145

Closed KiyoshiMori closed 4 years ago

KiyoshiMori commented 4 years ago

Hi. I got some bug that troubling me to use this library.

You can check it here: https://codesandbox.io/s/cool-feather-45gui?file=/src/App.js If you'll start to fast clicking from tab1 to tab2, you should notice some thrown error from the library. "Requested offset outside of the known ones, index: 0"

As far as I could understand, it's related to display: none and visibility-observer. Because when itemHeight is set you won't get this error. But it can't be a solution for me, because of my groupItemHeight and ItemHeight are different and I want autoheight anyway.

petyosi commented 4 years ago

This could be an easy fix. However, I had trouble reproducing it :(, perhaps I did not click too fast. Can you record a video? Also, please provide some info about browser / OS.

petyosi commented 4 years ago

oh, I think I figured it out. You need to scroll down the list first.

KiyoshiMori commented 4 years ago

For now (or sometimes) it's happening when I'm clicking not even fast. https://a.uguu.se/UVTl2wFD0pho_react-virtuoso

I'm using Linux & chrome. My colleague using Windows and he have it too.

KiyoshiMori commented 4 years ago

Also, if it could help, you can check this example to realize that it's happening precisely because of display: none/visibility-observer. https://codesandbox.io/s/determined-ganguly-o8oem?file=/src/App.js (Sometimes you need to scroll down first, sometimes not)

petyosi commented 4 years ago

@KiyoshiMori - the issue is addressed in v0.17.7