Skip to content

onClick handler on shape prevents PointingShape logic #5613

@mimecuvalo

Description

@mimecuvalo

What happened?

As noted on Discord:

This lovely line of tldraw logic makes it so one can't have an onClick handler on a Shape without interfering with pointerdown+drag to move the shape when it is not selected. Annoying behavior so probably an unintended side-effect? Fix/workaround?

Without having dug into the reasons here, my cursory reaction would be that we should be calling the shape maybe and seeing if it returns true/false? Not sure.

How can we reproduce the bug?

  1. Create a custom shape with an onClick handler.
  2. Make sure the shape is not selected
  3. Attempt the drag the shape

Expected

  • Shape is translated

Actual

  • onClick is triggered instead

What browsers are you seeing the problem on?

No response

Where did this happen?

The developer package

Contact Details

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

keep⚙️ Prevents issue from being marked stale or closed

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions