onPositionChange, onEnter and onLeave fire once on page load, and won't fire again until reload
See original GitHub issueI am using Waypoint to track whether a header has left the top of the viewport.
When a page is loaded (using Gatsbyjs’s wrapper for react-router’s Link
component) onPositionChange
, onEnter
and onLeave
are all fired at once (checked by using them to log a string to console), and then are never fired again when the page is scrolled. They are only fired again when I navigate to a different page, and they all fire at once again and the process repeats.
The debug
output shows that waypoints of the child div
are being tracked, and correctly identify when the div
has left the viewport.
Despite this, none of the functions are triggering on scroll - I’m not sure if this is connected to react-router similar to #249
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:19 (1 by maintainers)
Top Results From Across the Web
Timer will not fire "onclick". Fires on page load - Stack Overflow
Reset the timer so that you can click on the button to start the timer again; Prevent the timer being started again (which...
Read more >brigade - Bountysource
onPositionChange, onEnter and onLeave fire once on page load, and won't fire ... a different page, and they all fire at once again...
Read more >Onchange event on the field fires on the page load
Here is an example, using onload to check if the fields were changed from the UI. The change will not register the button...
Read more >Instrumentation Components Release Notes - Support
fire. 4. Added Support for CodeGear Delphi & C++ Builder 2009. 5. Added CustomizeLabelEventText property to the PlotAxis object. This new.
Read more >@elastic/eui | Yarn - Package Manager
Enhanced EuiSuggest to fire the onItemClick callback on Enter key press as ... for EuiColorPicker onBlur and onFocus callbacks (#1993); Fixed EuiIcon again...
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
I had a similar issue and the issue was coming from the
gatsby-plugin-transition-link
The plugin was adding an overflow-x:hidden, adding this to my styles fixed the issue.I’m experiencing the same issue above with Gatsby. If I wrap a block or place the following element in any of my components, every hook fires on initial page load and then nothing. Debug shows all the output as expected.