Skip to content

Blocks move using top left corner as origin instead of pointer coordinates #10077

Description

@mikeharv

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

When blocks are dragged on the workspace, the decision to delete them (or other actions like moving them to a backpack) is determined based on the block's getRelativeToSurfaceXY() coordinates. This creates unexpected behavior if the block is dragged from somewhere further right on the block.

Reproduction steps

  1. Using a mouse, click a block's middle or right side to begin a drag.
  2. Move the block such that it's left edge slightly overlaps the toolbox without the cursor overlapping the block. (The block would be deleted.)
  3. Move the cursor over the trashcan without touching the top-left corner of the block to the trashcan. (The block would not be deleted).

Priority

No response

Stack trace

Screenshots

The mouse cursor could not be captured in these screenshots, unfortunately, but it was position at the 'to' label at the middle of the block.

This block would be deleted if dropped here:

Image

This block would not be deleted if dropped here:

Image

Browsers

No response

Metadata

Metadata

Assignees

Labels

issue: bugDescribes why the code or behaviour is wrongissue: triageIssues awaiting triage by a Blockly team member

Type

No type
No fields configured for issues without a type.

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions