Skip to content

Commit 0bea583

Browse files
authored
fix: Fix bug that could cause focus to be lost when deleting a block (#9779)
1 parent b714ef7 commit 0bea583

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

packages/blockly/core/block_svg.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,14 @@ export class BlockSvg
918918
Tooltip.dispose();
919919
ContextMenu.hide();
920920

921+
if (animate) {
922+
this.unplug(healStack);
923+
blockAnimations.disposeUiEffect(this);
924+
}
925+
926+
super.dispose(!!healStack);
927+
dom.removeNode(this.svgGroup);
928+
921929
// If this block (or a descendant) was focused, focus its parent or
922930
// workspace instead.
923931
const focusManager = getFocusManager();
@@ -956,14 +964,6 @@ export class BlockSvg
956964
}
957965
}
958966
}
959-
960-
if (animate) {
961-
this.unplug(healStack);
962-
blockAnimations.disposeUiEffect(this);
963-
}
964-
965-
super.dispose(!!healStack);
966-
dom.removeNode(this.svgGroup);
967967
}
968968

969969
/**

0 commit comments

Comments
 (0)