From 9d7e403c9aa223ed8bda38a475fe5cb7ea41debb Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Wed, 3 Apr 2024 22:00:09 +0000 Subject: [PATCH 1/2] fix: blocks not being returned to the correct drag layer if their drag is reverted with no parent --- core/dragging/block_drag_strategy.ts | 3 +++ core/trashcan.ts | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/core/dragging/block_drag_strategy.ts b/core/dragging/block_drag_strategy.ts index d3f348e8fbf..fadba28fb69 100644 --- a/core/dragging/block_drag_strategy.ts +++ b/core/dragging/block_drag_strategy.ts @@ -429,6 +429,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( diff --git a/core/trashcan.ts b/core/trashcan.ts index b48777c4d74..379566d42e5 100644 --- a/core/trashcan.ts +++ b/core/trashcan.ts @@ -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. */ From 9350f461b308c0c2d19e22db95e413fea5c6cf37 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Mon, 8 Apr 2024 16:30:24 +0000 Subject: [PATCH 2/2] fix: delete test code --- core/trashcan.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/core/trashcan.ts b/core/trashcan.ts index 379566d42e5..b48777c4d74 100644 --- a/core/trashcan.ts +++ b/core/trashcan.ts @@ -697,14 +697,6 @@ 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. */