react-stockcharts
react-stockcharts copied to clipboard
preventDefault inside passive event listener error on Chrome 73
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
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
try remove e.preventDefault();
on line 109 EventCapture.js
@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>
Any better solution than removing the scrollbar ?
try remove
e.preventDefault();
on line 109 EventCapture.js
the chart will move with the wheel if remove this
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! :)
This lib is useless and unusable, until this bug is fixed!
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.
try remove
e.preventDefault();
on line 109 EventCapture.js
It is still an issue. Can you please remove it from lib?