Remove row healing for block deletion #4832 (#4873)

This commit is contained in:
jschanker
2021-06-08 20:13:17 -04:00
committed by GitHub
parent e3e1089641
commit 53d8754ee9
2 changed files with 9 additions and 2 deletions

View File

@@ -216,7 +216,12 @@ Blockly.deleteBlock = function(selected) {
if (!selected.workspace.isFlyout) {
Blockly.Events.setGroup(true);
Blockly.hideChaff();
selected.dispose(/* heal */ true, true);
if (selected.outputConnection) {
// Do not attempt to heal rows (https://github.com/google/blockly/issues/4832)
selected.dispose(false, true);
} else {
selected.dispose(/* heal */ true, true);
}
Blockly.Events.setGroup(false);
}
};

View File

@@ -479,7 +479,9 @@ Blockly.ContextMenuItems.registerDelete = function() {
},
callback: function(/** @type {!Blockly.ContextMenuRegistry.Scope} */ scope) {
Blockly.Events.setGroup(true);
scope.block.dispose(true, true);
if (scope.block) {
Blockly.deleteBlock(scope.block);
}
Blockly.Events.setGroup(false);
},
scopeType: Blockly.ContextMenuRegistry.ScopeType.BLOCK,