-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
[Error] Unable to preventDefault inside passive event listener invocation. #136
Comments
Hi! I guess the problem is in your I assume it looks like this: const setColor = (e) => {
e.preventDefault()
console.log(e.target.value)
} But react-colorful doesn't return an event object in the handler. So it has to be: const setColor = (value) => {
console.log(value)
} Please check your event hander and let me know if the problem is there. |
Unfortunately my code is exactly as per the Readme.
I've tested it on a blank page with no other components or touch events going on, and I can't seem to figure out why this is happening. |
Could you please provide an error stack trace? Just screenshot dev tools console for example. |
Not sure that error is inside of react-colorful since we don't use passive event listeners 🤔 |
I'll try to create a Meteor app and run react-colorful there. Let you once I have some results. |
Thank you very much for the help. |
Hi! What version of react-dom do you use in your project? |
My |
Got it. Seems like the source of the problem is that |
Interesting, thank you for the fix! Sincerely appreciated. |
Please try the new v5.2.2 and let me know the warning is still present. |
Just tested it and the warning isn't being thrown anymore, and it still works perfectly fine. |
Nice! Thanks for pointing out the bug and best of luck with your project) |
Hi, my browser's console keeps throwing this error, when all I have done is embedded
<HexColorPicker color={color} onChange={setColor} />
in a functional component.I tried setting
touch-action: none
to all parent divs up tobody
but the error is still being thrown. That being said, the color picker works fine on desktop and mobile, it's just that I'm not sure why this error is being thrown.Any suggestions on remedying this?
This is a great library by the way! I avoided starting off with
react-color
because it seems outdated and has many open issues, while this is far more recent and modernized. Thank you for this.The text was updated successfully, but these errors were encountered: