tldraw / tldraw

SDK for creating whiteboards and canvas experiences on the web.
https://tldraw.dev
Other
33.04k stars 1.98k forks source link

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

Open VarunNSrivastava opened 2 weeks ago

VarunNSrivastava commented 2 weeks ago

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

linear[bot] commented 2 weeks ago

TLD-2489 [Bug]: "Unable to preventDefault inside passive event listener invocation" on every gesture

MitjaBezensek commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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