-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chrome/React mouse-wheel event issue [Workaround] #141
Comments
Same here :/ |
This React issue has the relevant context. facebook/react#14856 Chrome 73 changed the behavior of wheel events to be "passive" by default. A passive event ignores any attempt to call |
Hi guys, until React has an official fix, we have to use the workaround published here facebook/react#14856 (comment) I hope that Facebook/Chrome will provide soon an official solution. |
Thanks @chrvadala you saved my day :) |
Today there isn't still an official solution, but a developer released a better workaround facebook/react#14856 |
Instead of attaching the event via attributes why don't you use |
To be honest I thought that React would have released an official fix for this, but it seems that, after 6 months, it is better to patch this library. |
There you go |
Bump |
A fix has been released with v3.5.0 (thanks to @krnlde ) Workaround code suggested few comments above is no more required. Don't forget to get it rid off. |
Seems like I introduced a new bug with this fix. I don't get any events on Edge and IE, can anybody confirm? x-ref: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7134034/ edit: This example doesn't work either: https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event |
Unfortunately now I don't have a Windows PC with me, but I should be able to test it tomorrow. |
The problem only occurs with "precision touchpads". The thinkpad nob and a mousewheel do work. |
sounds good! Is there a way to detect a "precision mousepad"? Do we have some way to fix it? |
Unfortunately no. I'm still wondering if it worked before, because if I read the bugtracker correctly it shouldn't work either way with the precision touchpad. Also this quote
makes me unhappy. It looked like probably These guys have the same problem it seems, maybe we can help each other out. |
Can you check if plain React wheel event works better? Moreover, I'm going to create a new issue since the topic we are talking about is a bit different from this one. |
I used the simplest codesandbox for this issue and don't get an event in the console on Edge. Which means it shouldn't either with synthetic nor with native events. |
Running Chrome Version 73.0.3683.86.
Trying to zoom in or out using the scroll wheel results in the page scrolling not only the image as expected.
And on the console inspector I see:
Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/6662647093133312
The url is slightly different to the one noted in this PR comment: #39 (comment)
The PR listed above seems to be related to touch specific actions Treat Document Level Touch Event Listeners as Passive, the one I am seeing in the console seems to be related to the wheel Treat Document Level Wheel/Mousewheel Event Listeners as Passive
I tested it in the examples listed on this page and it is reproducible on all the examples not just my code (one example I tested with: https://jsfiddle.net/chrvadala/f67qyfsd/)
I've already set
touch-action: none;
like most people suggest as the solution but had no luck.Strangely this is only affecting Chrome and all other browsers work as expected.
Please let me know if you need anything else from me to help. Thanks!
The text was updated successfully, but these errors were encountered: