From 23860381389669ded5519787befec34f3f2d1dbf Mon Sep 17 00:00:00 2001 From: RoboErikG Date: Fri, 17 May 2019 17:57:53 -0700 Subject: [PATCH] Fix bug with in bounds bumping (#2467) Traced one cause of Mocha tests sometimes failing to blocks being bumped back into bounds. It looks like a block being moved to be a child of another block was ended up out of bounds probably because the size of the workspace isn't set yet. When the change handler tried to move it back in it would throw an error since you can't move child blocks with that method. --- core/inject.js | 1 + 1 file changed, 1 insertion(+) diff --git a/core/inject.js b/core/inject.js index 8ecd1e1f7..4492bae58 100644 --- a/core/inject.js +++ b/core/inject.js @@ -294,6 +294,7 @@ Blockly.createMainWorkspace_ = function(svg, options, blockDragSurface, case Blockly.Events.BLOCK_CREATE: case Blockly.Events.BLOCK_MOVE: var object = mainWorkspace.getBlockById(e.blockId); + object = object.getRootBlock(); break; case Blockly.Events.COMMENT_CREATE: case Blockly.Events.COMMENT_MOVE: