Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/actions/mover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export class Mover {
this.moves.set(workspace, info);
// Begin drag.
dragger.onDragStart(info.fakePointerEvent('pointerdown'));
info.updateTotalDelta();
return true;
}

Expand Down
14 changes: 8 additions & 6 deletions src/keyboard_drag_strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ASTNode,
BlockSvg,
ConnectionType,
LineCursor,

Check warning on line 11 in src/keyboard_drag_strategy.ts

View workflow job for this annotation

GitHub Actions / Eslint check

'LineCursor' is defined but never used
RenderedConnection,
dragging,
utils,
Expand Down Expand Up @@ -60,12 +60,14 @@
// The next constrained move will resume the search from the current
// candidate location.
this.searchNode = ASTNode.createConnectionNode(neighbour);
// The moving block will be positioned slightly down and to the
// right of the connection it found.
// @ts-expect-error block is private.
this.block.moveDuringDrag(
new utils.Coordinate(neighbour.x + 10, neighbour.y + 10),
);
if (this.isConstrainedMovement()) {
// Position the moving block down and slightly to the right of the
// target connection.
// @ts-expect-error block is private.
this.block.moveDuringDrag(
new utils.Coordinate(neighbour.x + 10, neighbour.y + 10),
);
}
} else {
// Handle the case when unconstrained drag was far from any candidate.
this.searchNode = null;
Expand Down
Loading