mirror of
https://github.com/google/blockly.git
synced 2025-12-16 06:10:12 +01:00
fix: workspace shifts when deleting a block (#8666)
* fix: workspace shifts when deleting a block * fix: awaiting for block rerender * fix: create reusable method to prevent marking method as async
This commit is contained in:
committed by
GitHub
parent
eb79f667e2
commit
7219800183
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user