diff --git a/src/containers/blocks.jsx b/src/containers/blocks.jsx index 01aea5af3b48c8584231621e33942503fe9cf95a..345d21e26f5a7d4e79f5a336b930be989c51bc42 100644 --- a/src/containers/blocks.jsx +++ b/src/containers/blocks.jsx @@ -82,10 +82,12 @@ class Blocks extends React.Component { return; } // @todo hack to resize blockly manually in case resize happened while hidden + // @todo hack to reload the workspace due to gui bug #413 if (this.props.isVisible) { // Scripts tab this.workspace.setVisible(true); this.props.vm.refreshWorkspace(); window.dispatchEvent(new Event('resize')); + this.workspace.toolbox_.refreshSelection(); } else { this.workspace.setVisible(false); } @@ -176,6 +178,7 @@ class Blocks extends React.Component { const dom = this.ScratchBlocks.Xml.textToDom(data.xml); this.ScratchBlocks.Xml.domToWorkspace(dom, this.workspace); this.ScratchBlocks.Events.enable(); + this.workspace.toolbox_.refreshSelection(); if (this.props.vm.editingTarget && this.state.workspaceMetrics[this.props.vm.editingTarget.id]) { const {scrollX, scrollY, scale} = this.state.workspaceMetrics[this.props.vm.editingTarget.id];