react-stockcharts icon indicating copy to clipboard operation
react-stockcharts copied to clipboard

preventDefault inside passive event listener error on Chrome 73

Open seondizon opened this issue 5 years ago • 9 comments

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

seondizon avatar Mar 20 '19 18:03 seondizon

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

TomYeoman avatar Mar 21 '19 14:03 TomYeoman

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

ggianglv avatar Mar 29 '19 04:03 ggianglv

@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>

cj-clifton avatar Apr 04 '19 05:04 cj-clifton

Any better solution than removing the scrollbar ?

nvoisin avatar May 11 '19 14:05 nvoisin

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

the chart will move with the wheel if remove this

yunzhisun avatar May 28 '19 03:05 yunzhisun

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! :)

Samparkyn avatar Jul 11 '19 06:07 Samparkyn

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

n8tb1t avatar Jul 17 '19 22:07 n8tb1t

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

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.

estevanpedro avatar Jul 14 '20 20:07 estevanpedro

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

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

lenovog780 avatar Jan 26 '21 14:01 lenovog780