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
Console error when turning on device emulation in Chrome #2925
Comments
I'm having this same issue. Please let me know when you found any quick solution |
Considering this isn't a real issue, permit me to close it. I can't seem to reproduce this though and I doubt if it's coming from Chakra UI itself. If it becomes a real blocker to your project, feel free to let us know. Cheers. |
hm, I'm facing this issue when I use Radio component. @segunadebayo would you reopen this issue? |
Hey @hiroppy, could you provide a reproduction, please? |
yep, thanks. I'll prepare it soon. |
Hey, this bug still exists. Steps to reproduce:
Text form:
In CodeSandbox, the stack trace points to this function being invoked by chakra-ui/packages/checkbox/src/use-checkbox.ts Lines 364 to 370 in 5274a31
chakra-ui/packages/utils/src/function.ts Lines 11 to 20 in 5274a31
|
This issues still persit |
I'm having this problem as well, identical to this one. |
Am not trying to necro this one, but has this one been resolved by any chance? Not a big deal but looks like we still get this very message "Unable to prevent Default inside passive event listener invocation." when using radio buttons in emulator mode (it can be checked directly on the doc itself, by just selecting any of Naruto's character and just looking chrome dev tool console in device emulator mode). Would be glad to hear any workaround if any, tks. |
Log Warning: Prop `style` did not match. And Log Unable to preventDefault inside passive event listener invocation.: chakra-ui/chakra-ui#2925
Can this please be reopened? We are having this issue on our site as well. |
this issue still persists. check https://chakra-ui.com/docs/form/checkbox and open your browser's console. |
Having this error after selecting a
|
For those still experiencing this error: The issue is happening because the components' |
Still happening in Feb 2022... is there an ETA on when this is going to be resolved? |
Did anyone manage to resolve this? |
Is this actually causing some issues, or is it just an error in the console? |
I think it's just a warning/error in the console, I haven't found this to cause any issues. |
It's a simple fix though. Here's where the style I referenced above could be added to fix the issue if that helps:
|
Same: Did anyone manage to resolve this? |
In emulator mode, it prevents my form submit API call from going through. I also noticed that for checkboxes, the error only occurs when you click on the text part of the checkbox. Clicking directly on the box does not trigger the error. I hope the issue will be reopened and eventually resolved. |
As @matthewrose explained, import { extendTheme } from '@chakra-ui/react';
const theme = extendTheme({
components: {
Checkbox: { // can be Radio
baseStyle: {
label: {
touchAction: 'none',
},
},
},
},
}); |
@egurinko still not working, i'm using Radio buttons but I couldn't make it work with your solution |
@regMeet and others who view this: the style should not be on not on the chakra-ui/packages/checkbox/src/checkbox.tsx Line 149 in 9747c53
So the example from @egurinko should be updated to the following: import { extendTheme } from '@chakra-ui/react';
const theme = extendTheme({
components: {
Checkbox: { // can be Radio
baseStyle: {
container: {
touchAction: 'none',
},
},
},
},
}); That being said it should be simple to fix this in the code for the component or theme in |
@matthewrose still not working for me when using mobile web view and Radio component and clicking on the Radio's label |
Update: I realize now after further testing that the React uses passive event listeners for So I now suspect the fix for chakra is needed here, in the What I'm saying is we should not be using |
ran into this issue recently for the radio component, my solution is to add pointerEvents: "none" css to the label part
Seems to be working fine at the moment |
This one worked for me |
This is still a problem in the latest version. If I use a Checkbox or Radio button within a Modal, it prevents touch scrolling. This is a major issue as far as I'm concerned and this ticket should be reopened. This fix prevents touch scrolling on all radio buttons, thus it is not a solution:
|
I'm using Radio buttons and checkbox. When clikcing on their labels, I am having this issue. |
I solved my problem, in 2023 this bug still happens. When i clicked in radio input option, this error returns "Unable to preventDefault inside passive event listener invocation.". How to solve? Go to ur global styles in chakra and add "pointer-events: none;". PS: In my chakra version, this is the current className of span in Radio component, you need to evaluate if it's the same. |
🐛 Bug report
When I turn on emulation of device in Desktop Chrome and click the radio button and checkbox, I get the error "Unable to prevent Default inside passive event listener invocation."
This error does not occur when emulation is turned off.
The same problem occurs when you actually create a React app locally.
Also, there is no real harm, only a Chrome Console error occurs.
💻 Link to reproduction
Radio - Chakra UI
Checkbox - Chakra UI
📝 Additional information
Turn on device emulation
Turn off device emulation
The text was updated successfully, but these errors were encountered: