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

Cant set height of container

Open rahmatkruniawan opened this issue 7 years ago • 3 comments

I want set spefici height of element that use infinite scroll

<div style={{border : '1px solid black', maxHeight : 200, overflow : 'auto'}}>
    <InfiniteScroll
        pageStart={0}
        loadMore={this.loadItems.bind(this)}
        hasMore={this.state.hasMore}
        initialLoad={true}
        loader={loader}
        useWindow={true}
        isReverse={false}
    >
        <div className="tracks">
          {items}
        </div>
    </InfiniteScroll>
    <div ref={(el) => { this.messagesEnd = el; }}></div>
</div>

But when I render that's not load more item. load

rahmatkruniawan avatar Jul 06 '17 05:07 rahmatkruniawan

I recently updated the issue templates on this repo so that I can identify the bugs with this repo.

Please clone your layout and use of react-infinite-scroller by forking this Code Sandbox and linking it here. Doing so will massively expedite getting the bug fixed! 👊

danbovey avatar May 14 '18 19:05 danbovey

Same issue !

fregayeg avatar Jun 11 '19 12:06 fregayeg

You need to set the scrolling container with getScrollParent. Something like

<InfiniteScroll
      pageStart={0}
      loader={loader}
      hasMore={!allCaughtUp}
      loadMore={loadMore}
      useWindow={false}
      getScrollParent={() => document.getElementById('ThePusher')}
    >

hamidmayeli avatar Nov 09 '19 19:11 hamidmayeli