question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infinite scroll in *both* directions (i.e. down and up)

See original GitHub issue

Hey 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:closed
  • Created 4 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
AliNazariiicommented, Sep 24, 2020

Hi @bvaughn So there isn’t any solution for bidirectional infinite scrolling with virtualized lists? or any trick you suggest?

6reactions
bvaughncommented, Aug 31, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Infinite scrolling in both directions - Up and down
I am trying to create a page that is an endless scrolling loop both up and down. At the moment ...
Read more >
Infinite Scroll
Infinite Scroll is a JavaScript plugin that automatically adds the next page, saving users from a full page load. You've likely seen it...
Read more >
Infinite Scroll without Layout Shifts - Addy Osmani
Infinite scrolling is a loading strategy where new content is fetched and rendered while the user scrolls down a page.
Read more >
Infinite scroll vs load more button: which is better? | Publift
An infinite scroll setup loads content continuously as the user scrolls down the page, providing an ever-growing and seemingly never-ending ...
Read more >
Dealing with pagination (Infinite Scroll) - Tutorial - Octoparse
Sharpen your skills and explore new ways to use Octoparse. ... Make sure to set up enough scroll-down times and proper intervals between...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found