question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ES6 onScroll never fires

See original GitHub issue

I’ve been trying this out and I can’t seem to get it working.

export default class MyPage extends React.Component {
    render () { 
       return <div className='page-wrapper'
          onWheel={(e)=>console.log('WHEEL!!',e)}
          onScroll={(e)=>console.log('SCROLL!!',e)}>
          {... my page content ...}
        </div>;
    }
}

the onWheel fires normally, but the onScroll is not firing. I dunno if I’m missing something or this is a bug.

Thanks!

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:6
  • Comments:20 (4 by maintainers)

github_iconTop GitHub Comments

175reactions
probablyupcommented, Oct 4, 2015

@ddaza Add a true to the end of that window listener to enable capture mode.

28reactions
probablyupcommented, Aug 26, 2016

@admiral96 there are problems with the code you posted, but this a bug tracker not a Q&A - you’ll find better help on StackOverflow or something similar.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React/ES6 onScroll event not getting triggered - Stack Overflow
I have an onScroll event in my render function. When the site is scrolled it should trigger the listenScrollEvent function which outputs ...
Read more >
[Solved]-React/ES6 onScroll event not getting triggered-Reactjs
Coding example for the question React/ES6 onScroll event not getting triggered-Reactjs. ... Why React event handler is not called on dispatchEvent?
Read more >
Document: scroll event - Web APIs - MDN Web Docs - Mozilla
The scroll event fires when the document view has been scrolled. To detect when scrolling has completed, see the Document: scrollend event.
Read more >
Cant fire scroll event on react - The freeCodeCamp Forum
I have a submenu element, which appears when the user hovers over a menu item, and hides when(well you can guess when).
Read more >
JavaScript Scroll Events, Event Throttling & Passive Events
When you scroll a document or an element, the scroll events fire. You can trigger the scroll events in the following ways, for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found