diff --git a/core/rendered_connection.js b/core/rendered_connection.js index c77c53b3a..ef7130dc6 100644 --- a/core/rendered_connection.js +++ b/core/rendered_connection.js @@ -85,7 +85,8 @@ Blockly.RenderedConnection.prototype.bumpAwayFrom_ = function(staticConnection) reverse = true; } // Raise it to the top for extra visibility. - rootBlock.getSvgRoot().parentNode.appendChild(rootBlock.getSvgRoot()); + var selected = Blockly.selected == rootBlock; + selected || rootBlock.select(); var dx = (staticConnection.x_ + Blockly.SNAP_RADIUS) - this.x_; var dy = (staticConnection.y_ + Blockly.SNAP_RADIUS) - this.y_; if (reverse) { @@ -96,6 +97,7 @@ Blockly.RenderedConnection.prototype.bumpAwayFrom_ = function(staticConnection) dx = -dx; } rootBlock.moveBy(dx, dy); + selected || rootBlock.unselect(); }; /**