tldraw / tldraw

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

[Bug]: Inconsistent onClick behaviour between browsers #3903

Open OrionReed opened 3 weeks ago

OrionReed commented 3 weeks ago

What happened?

Chrome is inconsistent vs Firefox/Safari for onClick (and probably other) pointer events on custom shapes, requiring onPointerDown={(e)=>e.stopPropagation()} which is also not clearly documented.

How can we reproduce the bug?

Can be reproduced with any simple custom shape with this setup:

  1. Set pointerEvents: all on a custom shape
  2. Add a button with onClick={doSomething}

This works fine Safari/Firefox, but in Chrome you need to additionally add onPointerDown={(e)=>e.stopPropagation()} for it to work.

What browsers are you seeing the problem on?

Chrome

Contact Details

No response

Code of Conduct

linear[bot] commented 3 weeks ago

TLD-2568 [Bug]: Inconsistent onClick behaviour between browsers