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

Remove row healing for block deletion #4832 #4873

Merged
merged 8 commits into from
Jun 9, 2021
7 changes: 6 additions & 1 deletion core/blockly.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
Expand Down
4 changes: 3 additions & 1 deletion core/contextmenu_items.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down