mirror of
https://github.com/google/blockly.git
synced 2026-01-30 12:10:12 +01:00
fix: focus something after deleting a block (#9073)
This commit is contained in:
@@ -849,6 +849,17 @@ export class BlockSvg
|
||||
Tooltip.dispose();
|
||||
ContextMenu.hide();
|
||||
|
||||
// If this block was focused, focus its parent or workspace instead.
|
||||
const focusManager = getFocusManager();
|
||||
if (focusManager.getFocusedNode() === this) {
|
||||
const parent = this.getParent();
|
||||
if (parent) {
|
||||
focusManager.focusNode(parent);
|
||||
} else {
|
||||
focusManager.focusTree(this.workspace);
|
||||
}
|
||||
}
|
||||
|
||||
if (animate) {
|
||||
this.unplug(healStack);
|
||||
blockAnimations.disposeUiEffect(this);
|
||||
|
||||
Reference in New Issue
Block a user