Skip to content

Commit

Permalink
fix: awaiting for block rerender
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusslezinsky committed Nov 27, 2024
1 parent dffa3dd commit 8b0c04b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 3 additions & 2 deletions core/dragging/block_drag_strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
if (this.block.isShadow()) {
this.block.getParent()?.endDrag(e);
return;
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions core/dragging/dragger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ export class Dragger implements IDragger {
eventUtils.setGroup(origGroup);
root.dispose();
eventUtils.setGroup(newGroup);
} else {
this.workspace.setResizesEnabled(true);
}
}

Expand Down

0 comments on commit 8b0c04b

Please sign in to comment.