bvaughn / react-window

React components for efficiently rendering large lists and tabular data
https://react-window.now.sh/
MIT License
15.9k stars 787 forks source link

Layout resets when scrolling horizontally #544

Closed nickycdk closed 2 months ago

nickycdk commented 3 years ago

Im trying to combine react-window with react-window-scroller - but something strange is happening. If you scroll to the bottom of the list and then try scrolling horizontally, all content disappears - However, reappears when scrolling vertically again. It's like it's "resetting" after scrolling horizontally?

I've setup an example here: https://codesandbox.io/s/react-window-full-height-page-scroll-horizontal-fszut?file=/src/Test/TableAccuR.js

Try scrolling to the bottom of the list, then use the scrollbar to scroll horizontally, the content disappears? Any ideas ?

problem-react-window

sidharth-ping commented 3 years ago

Facing the same issue very odd. Any luck in fixing it?

RobinClowers commented 3 years ago

For posterity, the issue here is that the horizontal scroll event bubbles up to the react-window list, which causes it to reset to showing the first page of items. You can fix this by calling stopPropagation on the horizontal scroll event somewhere before it gets to the react-window element.

This is a byproduct of the way react-window-scroller works, and definitely not a bug in react-window, so I think this issue should be closed.

an-parubets commented 3 years ago

I have the same problem. Tried to fix it with stopPropagation and stopImmediatePropagation but to no avail. Did you manage to fix it successfully?

sidharth-ping commented 3 years ago

I switched to using react virtuoso which supports this and even dynamic sizes @an-parubets

coratype commented 9 months ago

I switched to using react virtuoso which supports this and even dynamic sizes @an-parubets

took me a total of 10 minutes to get this setup and working with Virtuoso, in comparison window was an absolute atrocity to work with.