Skip to content
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

[Bug]: "Unable to preventDefault inside passive event listener invocation" on every gesture #3686

Open
1 task done
VarunNSrivastava opened this issue May 3, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@VarunNSrivastava
Copy link

What happened?

"Unable to preventDefault inside passive event listener invocation" is logged as an error in the console on every gesture.

I discovered this while testing locally but found that it even happens on the main site tldraw.com.

How can we reproduce the bug?

Using a macbook (pro, m1) on chrome, open the console on tldraw.com. Draw anything.
Screenshot 2024-05-02 at 5 20 34 PM

What browsers are you seeing the problem on?

Chrome

Contact Details

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@VarunNSrivastava VarunNSrivastava added the bug Something isn't working label May 3, 2024
@MitjaBezensek
Copy link
Contributor

I'm not seeing this on my side. What version of Chrome are you using? Is this a local room or a multiplayer room? Can you try without browser extensions?

@cketcham
Copy link

cketcham commented May 6, 2024

I can reliably reproduce if I choose a device in chrome. The issue seems to be related to onTouchStart listeners that are set to passive by default so you can't prevent default behavior.

I'm not sure why those need default behavior prevented, do you know? I tried it and didn't notice any weird behavior.. but definitely could have just been because I didn't test extensively.

Looks like it's possible to manually add and remove event handlers ourselves though.

Do you prefer one or the other of those solutions?

@mimecuvalo
Copy link
Collaborator

I am able to repro but only currently on mobile. Happens via useCanvasEvents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants