From 68cee9da42ac7b4ed8eb7dcac2040a92e73ea8aa Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Tue, 16 Jan 2018 18:07:13 -0800 Subject: [PATCH] Fix #1539 --- core/workspace_svg.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/workspace_svg.js b/core/workspace_svg.js index b10ad779c..19fa87cf7 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -923,8 +923,9 @@ Blockly.WorkspaceSvg.prototype.paste = function(xmlBlock) { * @private */ Blockly.WorkspaceSvg.prototype.refreshToolboxSelection_ = function() { - if (this.toolbox_ && this.toolbox_.flyout_ && !this.currentGesture_) { - this.toolbox_.refreshSelection(); + var ws = this.isFlyout ? this.targetWorkspace : this; + if (ws && !ws.currentGesture_ && ws.toolbox_ && ws.toolbox_.flyout_) { + ws.toolbox_.refreshSelection(); } };