rrag / react-stockcharts

Highly customizable stock charts with ReactJS and d3
http://rrag.github.io/react-stockcharts
MIT License
3.87k stars 957 forks source link

preventDefault inside passive event listener error on Chrome 73 #715

Open seondizon opened 5 years ago

seondizon commented 5 years ago

Hello rrag,

Having issue after chrome update to version 73. Related to mouse scroll events, when zooming the chart. see: screenshot

https://developers.google.com/web/tools/lighthouse/audits/passive-event-listeners Chrome Version : Version 73.0.3683.75

Please help.

Thank you

TomYeoman commented 5 years ago

I'm also having this - The side effect is that when using the scroll within any chart the page scroll will "take priority" and scroll down on the page instead of remaining focused within the chart

ggianglv commented 5 years ago

try remove e.preventDefault(); on line 109 EventCapture.js

cj-clifton commented 5 years ago

@gianglevan94

try remove e.preventDefault(); on line 109 EventCapture.js

This didn't work for me, any other ideas?

EDIT: It does prevent the error, however the page still scrolls when zooming.

SOLUTION: Okay, to prevent scrolling, try this.

changeScroll(){
    let style = document.body.style.overflow 
    document.body.style.overflow = (style === 'hidden') ? 'auto':'hidden'
}

<div 
onMouseEnter={this.changeScroll}
onMouseLeave={this.changeScroll}
/>
    <YourChart/>
</div>
nvoisin commented 5 years ago

Any better solution than removing the scrollbar ?

yunzhisun commented 5 years ago

try remove e.preventDefault(); on line 109 EventCapture.js

the chart will move with the wheel if remove this

Samparkyn commented 5 years ago

try remove e.preventDefault(); on line 109 EventCapture.js

@rrag @gianglevan94 this didn't work for me, do you know if there is any other way of getting rid of this error? I have: zoomEvent={false} panEvent={true} clamp={true} in my ChartCanvas

thanks! :)

n8tb1t commented 5 years ago

This lib is useless and unusable, until this bug is fixed!

estevanpedro commented 4 years ago

changeScroll(){ let style = document.body.style.overflow document.body.style.overflow = (style === 'hidden') ? 'auto':'hidden' }

<div onMouseEnter={this.changeScroll} onMouseLeave={this.changeScroll} />

This fixed my problem ! I just added the <div {...}> {...} </ div> calling the func and it worked! Would be great to add this in the documentation.

lenovog780 commented 3 years ago

try remove e.preventDefault(); on line 109 EventCapture.js

It is still an issue. Can you please remove it from lib?