Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: workspace shifts when deleting a block #8666

Merged
merged 5 commits into from
Dec 4, 2024
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
15 changes: 10 additions & 5 deletions core/dragging/block_drag_strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,19 +384,24 @@ export class BlockDragStrategy implements IDragStrategy {
if (this.connectionCandidate) {
// Applying connections also rerenders the relevant blocks.
this.applyConnections(this.connectionCandidate);
this.disposeStep();
} else {
this.block.queueRender();
this.block.queueRender().then(() => this.disposeStep());
}

if (!this.inGroup) {
eventUtils.setGroup(false);
}
}

/** Disposes of any state at the end of the drag. */
private disposeStep() {
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);
}
}

/** Connects the given candidate connections. */
Expand Down
Loading