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.
This commit is contained in:
RoboErikG
2019-05-17 17:57:53 -07:00
committed by GitHub
parent b10a37a9af
commit 2386038138

View File

@@ -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: