-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Repro steps
- Load the basic test blocks
- Navigate to a stack block
- Press
mto enter movement mode - Notice that the block offsets slightly down and to the right

- Press
ctrl + Right Arrowto do an unconstrained move to the right. - Notice that the block position has not changed
- Press
ctrl + Right Arrowagain - Notice that the block has now moved to be disconnected

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.