Skip to content

Disconnecting through unconstrained movement takes multiple steps. #439

@rachel-fenichel

Description

@rachel-fenichel

Repro steps

  • Load the basic test blocks
  • Navigate to a stack block
  • Press m to enter movement mode
  • Notice that the block offsets slightly down and to the right
    Image
  • Press ctrl + Right Arrow to do an unconstrained move to the right.
  • Notice that the block position has not changed
  • Press ctrl + Right Arrow again
  • Notice that the block has now moved to be disconnected
    Image

This issue happens inconsistently: when moving the block from its initial location, it always happens. When moving the block from a different preview location, the issue occurs when moving to the left but not the right.

Analysis

There are several issues here. One is that moveUnconstrained does not call info.updateTotalDelta after calling onDrag, so the block's position and its record of total drag movement can get out of sync.

But if we fixed that by just calling info.updateTotalDelta, the block would be unable to move, because after every keypress it would snap back to its location slightly down and to the right of the candidate connection.

Another fix is to increase UNCONSTRAINED_MOVE_DISTANCE. This would mask but not resolve the problem.

To actually fix this, the keyboard dragger and/or mover code needs to check if it's an unconstrained move away from a candidate connection, move an appropriate distance to avoid the connection, and update the total delta appropriately.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions