Infinite scroll in *both* directions (i.e. down and up)
See original GitHub issueHey all,
I had to implement a time picker for work that was modeled off of an existing UWP/WPF component. The picker could scroll infinitely (or at least appeared to) in either direction, allowing the user to scroll to find the time they wanted in either direction.
I forked an existing codesandbox example to prove that react-window could do the job - which it did. But one thing I couldn’t achieve was the ability to scroll infinitely in the upward direction. I’m guessing that the list index is bounded to zero and cannot be negative, so I worked around it by setting the starting point far into the “future” thereby setting the index to a high number. See the line:
const numberOfDaysToScrollTo = 1000;
Just wondering if there is another way to solve this, or whether its a feature that you’d consider adding - it may have been proposed before.
But anyway, thanks for the awesome library.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (1 by maintainers)
Top GitHub Comments
Hi @bvaughn So there isn’t any solution for bidirectional infinite scrolling with virtualized lists? or any trick you suggest?
There’s no way to scroll past an offset of 0, unfortunately. So the only way you could implement something like that would be to use a hack similar to what you describe.
Bidirectional infinite scrolling doesn’t sound like a common enough use case (in my opinion) to be something I’d want to invest a ton of effort into to be honest.