Waypoint doesn't fire after switching url
See original GitHub issueI’m trying to implement infinite scroll with fetching data from server. On initial page load with fully browser reload everything works as expected, so waypoint fires every time when I scroll to page bottom. But if I go to page with infinite scroll from any another page (using react-router) then waypoint fires only once at page load, and never again when scrolling to page bottom. Could you please help me to figure out what can be the problem?
My code is:
import React from 'react'
import UserItem from './UserItem'
import Waypoint from 'react-waypoint'
export default (props) => {
return (
<div>
<div className='users-search-result clearfix'>
{props.users.map(user => <UserItem key={user.id} user={user} />)}
</div>
<Waypoint onEnter={props.onPageScroll}>
<div className='loader' />
</Waypoint>
</div>
)
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:8
Top Results From Across the Web
Why is waypoints not working? - Stack Overflow
A simple $(document). ready(function() { alert('You have scrolled to my waypoint. '); }); works fine, which tells me jquery is loaded and ...
Read more >[DOC BUG]: Fire tube, set waypoint - Cold Waters
I am a noob and a bit confused.. This doesn't seem to be just a manual error. The keys don't even work!! When...
Read more >Waypoint elements firing on page load · Issue #355 - GitHub
I'm using waypoints to hide and show elements at certain scroll points, however when the page loads waypoints fires before #back_to_top is ...
Read more >Switch to waypoint not working - Mission Editor Issues
When using the switch to waypoint function for AI unit the unit doesnt change waypoint. Might be because unit is attacking/patrolling an ...
Read more >How to import waypoints into GOHUNT Maps
After you've imported all your waypoints, now would be a great time to start to organize that data. For a complete walkthrough on...
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 Free
Top 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
I re-read your initial comment now. That was clear from the start, I was just a little quick to come to conclusions. Sorry!
The
debug
thing is still interesting though, it should give us a little more input. Try with a full page reload and with a react-router transition, then compare the different logs.Very interesting, glad you got it sorted! I wonder why the scrollable ancestor changed? This might be a bug in the waypoint code.