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.

Unable to load more results when initial list loaded is smaller than container

See original GitHub issue

Hi, really liking the library.

https://codesandbox.io/s/distracted-bogdan-zhcit?file=/src/index.js The above is a working example of inverse scrolling within a fixed height container of 300px.

If you modify the height (line 35) to 800px you’ll see an initial load that looks like: Screenshot 2020-10-14 at 15 48 50

There doesn’t seem to be any way to then trigger loading the next page of data.

Would this be something that would be possible to be addressed in this library? If there is no scrollbar, but there is still more data to fetch, then trigger the next function until there either is a scrollbar or there is no more data to fetch? Maybe you there is an alternative way to tackle this that I’m not thinking of as well.

Tested on

  • Chrome Version 86.0.4240.75
  • macOS Mojave Version 10.14.6

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:38
  • Comments:12

github_iconTop GitHub Comments

13reactions
jedster1111commented, Oct 27, 2020

@ADCrouch I ended up figuring something out, tried to recreate it in CodeSandbox. It’s a little bit rough around the edges and I couldn’t test the window resizing part but it should be a good enough starting point. https://codesandbox.io/s/vibrant-shannon-05o50?file=/src/Scroller.tsx

The logic is really just, if I’m not scrollable, there’s still data to be loaded, and I’m not already loading, then load some more data. 😄

8reactions
toschlogcommented, Feb 19, 2021

It would be super-nice if this logic were built in to react-infinite-scroll-component: If the element isn’t scrollable but more items are available, request more items.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to load more search results when scrolling down the ...
I work with google API book and I would like to load just 10 searching results and if user scroll to the last...
Read more >
React Hooks for infinite scroll: An advanced tutorial
This will be used to conditionally hide the “Load More” button when all items are loaded; This makes sure the page is populated...
Read more >
Preventing Content Reflow From Lazy-Loaded Images
Lazy loading doesn't guarantee that the image will fully load before it enters the viewport. The result is a perceived janky experience, even ......
Read more >
Lazy Loading Images – The Complete Guide - ImageKit.io
Let's first look at the more common of the two, the <img> tag, and then move on to CSS background images. The general...
Read more >
SQL OFFSET FETCH Feature: Loading Large Volumes of ...
In reality, smaller companies can't always adopt new storage, ... a SQL query and needs to show the results on several pages where...
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