From dffa3dd657177ef0853f8ecdb5ae5c9a59d3f6b5 Mon Sep 17 00:00:00 2001 From: Mateus Pereira Date: Mon, 18 Nov 2024 17:38:05 -0300 Subject: [PATCH 1/2] fix: workspace shifts when deleting a block --- core/dragging/block_drag_strategy.ts | 1 - core/dragging/dragger.ts | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/dragging/block_drag_strategy.ts b/core/dragging/block_drag_strategy.ts index c3be97da68..6c8a72d48d 100644 --- a/core/dragging/block_drag_strategy.ts +++ b/core/dragging/block_drag_strategy.ts @@ -392,7 +392,6 @@ export class BlockDragStrategy implements IDragStrategy { // Must dispose after connections are applied to not break the dynamic // connections plugin. See #7859 this.connectionPreviewer!.dispose(); - this.workspace.setResizesEnabled(true); if (!this.inGroup) { eventUtils.setGroup(false); diff --git a/core/dragging/dragger.ts b/core/dragging/dragger.ts index 8a9ac87c6a..a88dffafdc 100644 --- a/core/dragging/dragger.ts +++ b/core/dragging/dragger.ts @@ -125,6 +125,8 @@ export class Dragger implements IDragger { eventUtils.setGroup(origGroup); root.dispose(); eventUtils.setGroup(newGroup); + } else { + this.workspace.setResizesEnabled(true); } } From 8b0c04bc1959fc2d9acd5da46dc831dfacf18fe7 Mon Sep 17 00:00:00 2001 From: Mateus Pereira Date: Tue, 26 Nov 2024 21:17:59 -0300 Subject: [PATCH 2/2] fix: awaiting for block rerender --- core/dragging/block_drag_strategy.ts | 5 +++-- core/dragging/dragger.ts | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/dragging/block_drag_strategy.ts b/core/dragging/block_drag_strategy.ts index 6c8a72d48d..0e43a417dc 100644 --- a/core/dragging/block_drag_strategy.ts +++ b/core/dragging/block_drag_strategy.ts @@ -358,7 +358,7 @@ export class BlockDragStrategy implements IDragStrategy { * Cleans up any state at the end of the drag. Applies any pending * connections. */ - endDrag(e?: PointerEvent): void { + async endDrag(e?: PointerEvent): Promise { if (this.block.isShadow()) { this.block.getParent()?.endDrag(e); return; @@ -385,13 +385,14 @@ export class BlockDragStrategy implements IDragStrategy { // Applying connections also rerenders the relevant blocks. this.applyConnections(this.connectionCandidate); } else { - this.block.queueRender(); + await this.block.queueRender(); } this.block.snapToGrid(); // Must dispose after connections are applied to not break the dynamic // connections plugin. See #7859 this.connectionPreviewer!.dispose(); + this.workspace.setResizesEnabled(true); if (!this.inGroup) { eventUtils.setGroup(false); diff --git a/core/dragging/dragger.ts b/core/dragging/dragger.ts index a88dffafdc..8a9ac87c6a 100644 --- a/core/dragging/dragger.ts +++ b/core/dragging/dragger.ts @@ -125,8 +125,6 @@ export class Dragger implements IDragger { eventUtils.setGroup(origGroup); root.dispose(); eventUtils.setGroup(newGroup); - } else { - this.workspace.setResizesEnabled(true); } }