petyosi / react-virtuoso

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

[BUG] Window scrolling not working #295

Closed laggingreflex closed 3 years ago

laggingreflex commented 3 years ago

Describe the bug

New to this. Trying to use Window Scrolling (which is what drew me to this library, other than dynamic height of course!).

It seems the list isn't updated (items below-the-fold don't show up)

GIF

Reproduction

https://github.com/laggingreflex/repro-react-virtuoso-window-scrolling

I created that simple repro first. But then I tried to recreate it on codesandbox where the issue disappears! https://codesandbox.io/s/repro-react-virtuoso-window-scrolling-xstbt

Not sure why. I can definitely repro the issue on a standalone app, but not on codesandbox.

To Reproduce Steps to reproduce the behavior:

For standalone app, clone the above repo, run it locally.

Then just scroll.

Expected behavior

It should show all 1000 elements

Screenshots

See above

Desktop (please complete the following information):

laggingreflex commented 3 years ago

Ah, <!DOCTYPE html> was missing from my app, adding which fixed it!

Don't understand yet why, but there's some confirmation why it might happen: https://stackoverflow.com/questions/4815283/using-doctype-let-scrolltop-return-0-why