Thanks @bvaughn for creating such an amazing library.
I have one quick question:
I want to the scroll should happen on the body / page of the website. Just like in instagram where the scroll bar or scroll happens on the page, i want to have a similar experience with my page. Currently, i am not able to achieve that because the default behavior of the scroll happens on the div child component of the body. How to fix this?
Do i have any options that i can tweak to change the behaviour?
Thanks
Aravind
Thank you!
This sounds like a duplicate of #30 so I'm going to just copy-paste my answer from that issue since it still applies 😄
What your'e describing isn't supported by react-window. It was supported by react-virtualized, via a WindowScroller component, but WindowScroller was one of those painful to maintain components. I see the usefulness of it, but I'm not sure I'm interested in committing to maintain another one. I would prefer instead, if possible, for an external component to be built (and published separately) that implements this functionality on top of react-window.
I might be willing to make a couple of changes to react-window to support such a component, if it existed, depending on how complex they would be.
If you're willing to put together a proposal (demo code, proposed API changes) I'm willing to talk it over and consider potential, minor changes to this library– but I'm confident that I'm not interested in the following at this time:
WindowScroller (or similar) component to the react-window package. I don't have the time or desire to take on the maintenance burden of such a component.scrollLeft and scrollTop. That sort of an API (mix of controlled an uncontrolled props for scroll offset) [was a big regret of mine with react-virtualized](https://twitter.com/brian_d_vaughn/status/959600888242307072?lang=en. It's best to either go fully controlled (no state, only props) or fully uncontrolled (only state, with maybe a props.defaultValues that's read only once before mounting). react-window already has an uncontrolled API for this (with imperative methods for setting an overridden value).I'm going to close this issue now because I don't plan on taking any direct action, but we can continue the discussion here 😄
@bvaughn I also wanted to synchronize the scroll position between the list and the window so I wrote my own package: https://github.com/FedericoDiRosa/react-window-scroller
Maybe a naive approach but it works in my tests..
Most helpful comment
@bvaughn I also wanted to synchronize the scroll position between the list and the window so I wrote my own package: https://github.com/FedericoDiRosa/react-window-scroller
Maybe a naive approach but it works in my tests..