esnet / react-timeseries-charts

Declarative and modular timeseries charting components for React
http://software.es.net/react-timeseries-charts
Other
861 stars 284 forks source link

Scrolling to zoom in a ChartContainer will also scroll the entire page #375

Closed igozali closed 5 years ago

igozali commented 5 years ago

🐛Bug report

Describe the bug Scrolling to zoom in or out of the ChartContainer will also cause the entire page to scroll. Before Chrome 73, this works properly.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://software.es.net/react-timeseries-charts/#/example/cycling
  2. Resize window so that the vertical bar shows up
  3. Scroll to zoom in or out in the chart

Expected behavior Chart zooms in, but page doesn't scroll down.

Desktop (please complete the following information):

Additional context In Chrome 73, they started ignoring e.preventDefault() calls inside wheel events. See this link: https://developers.google.com/web/updates/2019/02/scrolling-intervention

The relevant part of the code, I believe is: https://github.com/esnet/react-timeseries-charts/blob/master/src/components/EventHandler.js#L63

Also, there's an issue in React about supporting passive event listeners (they haven't, yet).