scrollableTarget not trigger
See original GitHub issueHi !! I am having some trouble with scrollableTarget prop. When I set the prop, the next function never gets triggered. It seems that I am doing something wrong but I can’t see what …
Here is some part of my code:
<Grid.Column width={11} id='billList' className='bill-content fdx-content bill-list-container'>
<InfiniteScroll
dataLength={this.props.bills.length} //This is important field to render the next data
next={this.loadBills}
scrollableTarget={document.getElementById('billList')}
onScroll={()=> {console.log(document.getElementById('billList'))}}
hasMore={this.state.hasMore}
loader={<Loader status={this.props.isFetching} />}
endMessage={
<p style={{textAlign: 'center'}}>
<b>Yay! You have seen it all</b>
</p>
}>
<BillList
localId={local.id}
token={token}
getBills={getBills}
openSidebar={this.openSidebar}
isSidebarOpen={isSidebarOpen}
bills={this.props.bills}
/>
</InfiniteScroll>
</Grid.Column>
I have a ‘Grid’ parent div which has billList as ID. This means that the InfiniteScroll is not working with the div scroll. Besides, if I set a particular height to the InifniteScroll component the onScroll function logs all actions.
I have also looked for some examples with the scrollableTarget option working, but it seems that there is any one in the repo.
I hope you can help me !!
Guido
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
next prop not working in react-infinite-scroll-component
i tried giving id="scrollableDiv" to every div in the page and also <html> in index.html still no use. when i remove the scrollableTarget=" ......
Read more >react-infinite-scroll-component - npm
An Infinite Scroll component in react.. Latest version: 6.1.0, last published: 2 years ago. Start using react-infinite-scroll-component in ...
Read more >React-infinite-scroll-component NPM - npm.io
infinite scroll with scrollableTarget (a parent element which is scrollable) ... It must trigger some sort of action which fetches the next data....
Read more >How to setup Infinite Scroll in your react component?
This is one of the most important prop, We pass a loadMoreData function to it that triggers some action which fetches the next...
Read more >react-infinite-scroll-component | Yarn - Package Manager
</h4>} scrollableTarget="scrollableDiv" > {this.state.items.map((_, index) => ( <div ... It must trigger some sort of action which fetches the next data.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please find a working sample here https://codesandbox.io/s/r7rp40n0zm
Instead of passing the node reference like
document.getElementById("some-div")
just pass theid
of the DOM element.No no, so giving an
id
to Grid.Column will not work,id
should be on a DOM node. Grid.Column won’t setid
to any element. So when InfiniteScroll component does document.getElementById(‘billList’) it’ll not get anything.Can’t you pass a height, or let the scroll happen at the window?
On Thu, 17 May 2018 at 18:01 Guido notifications@github.com wrote: