I'm using AutoSizer
for one of the use cases in my application. in Autosizer code, they change the scrollTop due to which the scroll event is getting triggered. As the scroll events are captured (and not bubbled), how do I prevent scroll event in AutoSizer (or restrict the event only to the desired element)? The one way I could find is, checking if the target
and currentTarget
is same in the event handler
onScroll = event => {
if(event.target === event.currentTarget){
...do Something
}
}
Is this the right way to do it or there is some other way?
P.S. I'm using react
in my application