diff --git a/core/flyout.js b/core/flyout.js index 3f50fe3f1..72b3f00bb 100644 --- a/core/flyout.js +++ b/core/flyout.js @@ -1162,6 +1162,10 @@ Blockly.Flyout.prototype.createBlockFunc_ = function(originBlock) { return; } Blockly.Events.disable(); + // Disable workspace resizing. Reenable at the end of the drag. This avoids + // a spurious resize between creating the new block and placing it in the + // workspace. + flyout.targetWorkspace_.setResizesEnabled(false); try { var block = flyout.placeNewBlock_(originBlock); } finally { @@ -1181,8 +1185,6 @@ Blockly.Flyout.prototype.createBlockFunc_ = function(originBlock) { Blockly.dragMode_ = Blockly.DRAG_FREE; block.setDragging_(true); block.moveToDragSurface_(); - // Disable workspace resizing. Reenable at the end of the drag. - flyout.targetWorkspace_.setResizesEnabled(false); }; };