Skip to content

Disconnecting through unconstrained movement takes multiple steps. #439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rachel-fenichel opened this issue Apr 15, 2025 · 0 comments
Open
Labels

Comments

@rachel-fenichel
Copy link
Contributor

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.

@rachel-fenichel rachel-fenichel added documentation Improvements or additions to documentation triage and removed documentation Improvements or additions to documentation labels Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant