Skip to content

Commit

Permalink
fix: blocks not being returned to the correct drag layer if their dra…
Browse files Browse the repository at this point in the history
…g is reverted with no parent
  • Loading branch information
BeksOmega committed Apr 3, 2024
1 parent a73e8a3 commit 37b0ffb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/dragging/block_drag_strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ export class BlockDragStrategy implements IDragStrategy {
}
} else {
this.block.moveTo(this.startLoc!, ['drag']);
this.workspace
.getLayerManager()
?.moveOffDragLayer(this.block, layers.BLOCK);
// Blocks dragged directly from a flyout may need to be bumped into
// bounds.
bumpObjects.bumpIntoBounds(
Expand Down
8 changes: 8 additions & 0 deletions core/trashcan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,14 @@ export class Trashcan
};
return blockInfo;
}

wouldDelete(_element: IDraggable): boolean {
return false;
}

shouldPreventMove(_dragElement: IDraggable): boolean {
return true;
}
}

/** Width of both the trash can and lid images. */
Expand Down

0 comments on commit 37b0ffb

Please sign in to comment.