Skip to content
Merged
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
8 changes: 6 additions & 2 deletions packages/blockly/core/keyboard_nav/keyboard_mover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ export class KeyboardMover {

static mover = new KeyboardMover();

/** Whether or not something is currently being moved. */
private moving = false;

// Constructor is private to keep this class a singleton.
private constructor() {}

Expand All @@ -94,7 +97,7 @@ export class KeyboardMover {
* @returns True iff a workspace element is being moved.
*/
isMoving() {
return !!this.draggable;
return this.moving;
}

/**
Expand All @@ -106,7 +109,7 @@ export class KeyboardMover {
*/
startMove(draggable: IDraggable, event?: KeyboardEvent) {
if (!this.canMove(draggable) || this.isMoving()) return false;

this.moving = true;
const DraggerClass = registry.getClassFromOptions(
registry.Type.BLOCK_DRAGGER,
draggable.workspace.options,
Expand Down Expand Up @@ -354,6 +357,7 @@ export class KeyboardMover {
this.dragger = undefined;
this.startLocation = undefined;
this.totalDelta = new Coordinate(0, 0);
this.moving = false;
}

/**
Expand Down
Loading