scrollableTarget not working
See original GitHub issueHi, i was having trouble while using infinite scrolling, because data was being loaded when my browsers main window scrollbar scrolled. So i tried using scrollableTarget to fix the problem, but when i tried using it the loader keeps displaying and no data is fetched. Code looks like this:
<Container id="divID">
<InfiniteScroll
dataLength={this.state.logs.length}
next={this.fetchMoreData}
hasMore={true}
loader={<Loader />}
scrollableTarget="divID"
>
<Table striped>
<thead>
<tr>
<th>...</th>
<th>...</th>
<th>...</th>
</tr>
</thead>
<tbody>
{this.state.logs.map(event => (
<tr key={event.id}>
<td>....</td>
<td>....</td>
<td>....</td>
</tr>
))}
</tbody>
</Table>
</InfiniteScroll>
</Container>
Here you can see the id of Container
I Also tried using scrollableTarget=document.getElementById("divID")
and it now renders the content but it only loads more data when the main window scrollbar moves not when the one in my Table element does.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (3 by maintainers)
Top Results From Across the Web
React InfiniteScroll in a scrollable component on the page
I am trying to build an infinite scroll in a div with a fixed height and a scroll attached to it, so my...
Read more >react-infinite-scroll-component v6.1.0
infinite scroll with scrollableTarget (a parent element which is scrollable) ... Note that the scroll event is throttled, so you may not receive...
Read more >react-infinite-scroll-component
If your scrollable content is being rendered within a parent element that is already providing overflow scrollbars, you can set the scrollableTarget prop...
Read more >React infinite scroll scrollableTarget get id dynamically?-rx.js
[Solved]-React infinite scroll scrollableTarget get id dynamically?-rx.js. Search. score:1. the problem is solved like this scrollableTarget={item.id.
Read more >react-infinite-scroll-component
Start using react-infinite-scroll-component in your project by running `npm i react-infinite-scroll-component`. There are 350 other projects ...
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
@ankeetmaini sorry if i didnt make myself clear, I want
next
to be called when my Table’s scrollbar reaches the end, but what is actually happening in the code above is thatnext
is called when the main window scroll moves.Hi, I know this issue has been closed, but are we still able to get a response? I’m having a similar issue as many of those previously. I’ve set up InfinteScroll to wrap around a Table. InfinteScroll & Table are located inside of a TableContainer component. The TableContainer has an id which I used as the
scrollableTarget
in InfinteScroll. In my main page, my table scrolls as expected with more data loading when I pass the threshold. However, when I try to use my table in a Dialog, InfinteScroll no longer works. When I scroll, I’m not reaching mynext
function. How can InfinteScroll work while on a main window, but not when in a Dialog?