`onLeave` isn't fired when `onPositionChange` does
See original GitHub issue <Waypoint
onPositionChange={position => console.log(position)}
scrollableAncestor={typeof window !== 'undefined' && window}
onEnter={this.showHeaderButtons}
onLeave={this.hideHeaderButtons} />
onLeave
fires when scrolling normally.
But when scrolled to the bottom of the page and then refreshing the page the browser scrolls to the bottom when the page has been loaded and while onPositionChange
fires correctly with the above
updated position onLeave
doesn’t get called at all.
Issue Analytics
- State:
- Created 7 years ago
- Comments:11
Top Results From Across the Web
onLeave isn't fired when onPositionChange does #155 - GitHub
onLeave fires when scrolling normally. But when scrolled to the bottom of the page and then refreshing the page the browser scrolls to...
Read more >onChange event is not getting fired on react - Stack Overflow
onChange will be triggered only when the textbox element loses focus. You may look for the oninput event.
Read more >react-waypoint - npm
A waypoint normally fires onEnter and onLeave as you are scrolling, but it can fire because of other events too: When the window...
Read more >react-waypoint@9.0.3 | runpkg
If `str` isn't a percentage, then `undefined` will be returned. ... If the scroll event isn't fired often enough to occur while the....
Read more >brigade - Bountysource
onPositionChange, onEnter and onLeave fire once on page load, and won't fire again until reload ... Its instance type 'Waypoint' is not a...
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
As an aside, I could be convinced of there being a callback as a prop that is fired immediately when the component mounts, which is passed the initial position. To implement this, we would need the callback prop to be called after this line.
An example API would be:
I’m not convinced that we need this right now, but if someone could show that it:
then I’d likely be 👍 for this new prop.
I was thinking that, @lencioni . I can PR a thing up later today, unless you’d like to take a stab at it.