react-infinite-scroller icon indicating copy to clipboard operation
react-infinite-scroller copied to clipboard

load more function is not getting invoked!

Open developerk786 opened this issue 7 years ago • 20 comments

Load More function is not getting invoked when scroll to down *Expected to see "loaded!"' two three times but not, please help me screenshot from 2018-10-16 15-11-00

       loadMoreBooks = async () => {
         console.log('loaded!');
         const data = await db.collection('books').get();
         let books = this.state.books;
         data.forEach(book => {
           books = [...books, { id: book.id, ...book.data() }];
         });
         this.setState({ books });
      };

     // Render Method
          <InfiniteScroll
            pageStart={0}
            loadMore={this.loadMoreBooks}
            hasMore={hasMoreBooks}
            loader={
              <div className="loader" key={0}>
                Loading ...
              </div>
            }
          >
            <Tiles maxCount={4}>{bookList}</Tiles>
          </InfiniteScroll>

developerk786 avatar Oct 16 '18 09:10 developerk786

It's the same here

andrelmlins avatar Oct 21 '18 11:10 andrelmlins

@andrelmlins let me know if you solved somehow

developerk786 avatar Nov 15 '18 18:11 developerk786

Same problem! Any solutions?

erksch avatar Nov 29 '18 15:11 erksch

For a temporary fix while they figure that out I went from "react-infinite-scroller": "^1.2.2" to "react-infinite-scroller": "^1.2.1" and then it started working again.

andrewpjames13 avatar Nov 30 '18 14:11 andrewpjames13

Having the same issue in "react-infinite-scroller": "^1.2.4". load more is not invoking when I scroll down to the end of the list. Didn't they fix this issue yet?

Ahsan-J avatar Feb 11 '19 08:02 Ahsan-J

Also seeing the same issue I tried 1.2.1 and 1.2.4 with no luck

GarrettJMU avatar Feb 14 '19 23:02 GarrettJMU

same issue. hopeless! 1.2.1 and 1.2.4

BeanMc avatar Feb 16 '19 04:02 BeanMc

version 1.2.4 was working before but not working from last few days

arpitprod avatar Mar 05 '19 07:03 arpitprod

We're on 1.2.2 and setting useWindow to false restores the loading behavior, if that's an option for your case.

ckarle avatar Mar 06 '19 19:03 ckarle

For a temporary fix while they figure that out I went from "react-infinite-scroller": "^1.2.2" to "react-infinite-scroller": "^1.2.1" and then it started working again.

doesn't work.. "react-infinite-scroller": "^1.2.1",

TimorCookie avatar Mar 19 '19 08:03 TimorCookie

Have the same issue on v1.2.4

mykyta-nikiforov avatar May 17 '19 10:05 mykyta-nikiforov

I found the point.

  1. if your scroll area not window, userWindow={false}
  2. make sure the InfiniteScroll tag directly wrap the scroll area like that <InfiniteScroll><YourScrollDiv> other children ... </YourScrollDiv></InfiniteScroll>

totemtec avatar Jul 04 '19 16:07 totemtec

Same issue here with 1.2.1 and 1.2.4

TiagoFuelber avatar Jul 17 '19 20:07 TiagoFuelber

How to make it in dropDown @totemtec? when you have like:

dropDownRender={ children => ( <InfiniteScroll pageStart={ lastPage } loadMore={ handleInfiniteOnLoad } hasMore={ hasMoreRefCodes } useWindow={ false } > { children } </InfiniteScroll> ) }

erwista avatar Nov 30 '19 15:11 erwista

Did you ever resolve this? If so, how?

olelivalife avatar Aug 24 '20 12:08 olelivalife

If any upper element has 'overflow: auto;' defined, it means that scroll area is not window anymore:

  1. userWindow={false}
  2. define getScrollParent function to return 'scroll area' dom element

<InfiniteScroll ... getScrollParent={()=>document.getElementById('el-which-has-overflow-defined')} useWindow={false}>

hennadiy-kudashev avatar Feb 09 '21 11:02 hennadiy-kudashev

@totemtec @hennadiy-kudashev It's named useWindow, not userWindow

radarfox avatar Mar 25 '21 23:03 radarfox

Yeah it is useWindow not userWindow

pratyush-shivam avatar Mar 02 '22 11:03 pratyush-shivam

If any upper element has 'overflow: auto;' defined, it means that scroll area is not window anymore:

  1. userWindow={false}
  2. define getScrollParent function to return 'scroll area' dom element

<InfiniteScroll ... getScrollParent={()=>document.getElementById('el-which-has-overflow-defined')} useWindow={false}>

Thank you so much! This works! I'm on version 1.2.4

Shivaansh-Agarwal avatar May 25 '22 13:05 Shivaansh-Agarwal

None of the above worked for me I'm afraid, the load more function either wasn't called or was called twice depending on the screen size and some other styling, so I've ended up replacing this component with another one, fairly compatible: https://www.npmjs.com/package/react-infinite-scroll-component

and that resolved the issue for me.

kszlachetka-bolt avatar Aug 13 '24 08:08 kszlachetka-bolt