petyosi / react-virtuoso

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

Window Scroll Bug when there is a overflow:scroll area #474

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hey guys.

Describe the bug I have an app that consists of a static header (lets say 30% of the viewport height) and a center content section (rest of the viewport height). I added "overflow:scroll" to the center section such that the user can scroll if the content will get larger than the remaining 70% viewport height. If I don't add useWindowScroll everything works fine (as you can see below in the sandbox) but there are two scroll areas inside each other which makes it hard to navigate. After adding useWindowScroll, at first sight it seems to work that Virtuoso uses the scroller from the center content but after five elements the list is just empty.

Reproduction https://codesandbox.io/s/cranky-benz-q2cm6?file=/src/App.js

To Reproduce You can just uncomment the useWindowScroll in the Sandbox and the bug will show up.

Expected behavior Is it possible that Virtuoso uses the scroller from the center content?

Desktop (please complete the following information):

Thanks in advance for your help!

Manuel

petyosi commented 3 years ago

This is a feature request, a duplicate of this: https://github.com/petyosi/react-virtuoso/issues/320

ghost commented 3 years ago

Oh sorry I didn't find this! Good to know that you are working on it.

ebrahimsakirmi commented 10 months ago

@ManuelKraemer hello have you found the solution for it?