window.addEventListener("scroll"... doesn't work
See original GitHub issueI noticed this problem while using react-infinite and then I tried it in the REPL, I added the following line to the default example:
window.addEventListener("scroll",()=>alert("hi"));
The listener is registered
But it does nothing.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Javascript Scroll Handler not firing - Stack Overflow
Try changing your element listener to the parent of the div (in this case the window) like this. window.addEventListener("scroll", function () { ...
Read more >Window Scroll Event NOT Working | Debugging Event Listener
In this video, we will debug an event listener. Events are many: mouse events, touch events, keyboard events, form events, window events, ...
Read more >Scroll event not working on clients environment ... - OutSystems
The problem is that the scroll event is not working on their environment but working on our end. I tried to attach a...
Read more >Document: scroll event - Web APIs - MDN Web Docs - Mozilla
For element scrolling, see Element: scroll event . Syntax. Use the event name in methods like addEventListener() , or set an event handler...
Read more >Scroll events, React Hooks and Refs | Coding time
addEventListener("scroll", handleScroll) } // Now we should attach the listener // any time we render a new div, right? // Unfortunately this does...
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
If someone end up here having the same issue, on my side adding
{ capture: true }
as an options toaddEventListener
did the trick for me.thx a lot man ❤️