react-infinite-scroll-component icon indicating copy to clipboard operation
react-infinite-scroll-component copied to clipboard

When adjusting the height of the window, loader is exposed but nothing will load

Open 2hands10fingers opened this issue 4 years ago • 3 comments

I'll have a short window, and when I extend the height down to see more results, I get maybe a few that will show, but my loader which says "Loading..." will also be in view but refuses to load anymore data. Albertson_s_Supervisor

What's the best way to handle this?

2hands10fingers avatar Nov 13 '20 00:11 2hands10fingers

@2hands10fingers I struggle with the same issue. Have you already found any solution?

rafalkowalski avatar Feb 15 '21 11:02 rafalkowalski

I got same problem. In my case, i found that if dataLength is changed after each loading then i can load more data Example: Not load: dataLength={totalNumberOfRecords} // dataLength never change Load more: dataLength={currentNumberOfRecords} // dataLength change after each load

khoibv avatar Feb 21 '21 16:02 khoibv

Here is what im doing as a workaround.

All i do is check every render if the scrollHeight is equal to the offsetHeight of the scrollableTarget provided to the InfiniteScroll. If it is then we know we need to load more data. If it isnt we dont need to do anything.

TheDevCactus avatar May 03 '21 16:05 TheDevCactus