Open dirkdevriendt opened 5 years ago
Is there any way to make this less Firefox dependent? Is there a more general fix to this problem? I'm not too excited about adding fixes that only address the issue in a single browser.
In other words is there a standard way to detect that scrolling will be slow instead of saying "oh, it's firefox let's scroll faster". In the future if Firefox updates its behavior here then we'll be compensating for an issue that doesn't exist any longer and will create a new bug to fix.
That said this is the real world and there may not be a cleaner fix.
Also, thanks for looking into this, it is appreciated!
I just did this quick fix in the same vain as the hard coded compensation that was already there, but apparently there is a more generic way in the form of -sadly, slightly inconsistent/magical- mouse scroll event properties (e.g. wheelDelta and deltaMode).
This SO question: https://stackoverflow.com/questions/5527601/normalizing-mousewheel-speed-across-browsers points to a number of solutions, such as this Fiddle: http://jsfiddle.net/uNeBr/ or this Facebook code: https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js which seems to have inspired this library: https://www.npmjs.com/package/normalize-wheel
To clarify a bit, my understanding is that deltaMode (https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/deltaMode) defines if the browser measures scrolling in pixels/lines/pages (which is the big -20X- difference to account for), while wheelDelta/deltaX and friends seem to allow for "calibration" differences.
can't it be merged? pls
Fixes https://github.com/esnet/react-timeseries-charts/issues/302 Reference for Firefox check: https://stackoverflow.com/a/9851769