Skip to content

Commit 52ac752

Browse files
gonfunkocwillisf
authored andcommitted
fix: partially roll back flyout optimization (#25)
1 parent 9703bc6 commit 52ac752

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/scratch-gui/src/containers/blocks.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,16 @@ class Blocks extends React.Component {
238238
this.ScratchBlocks.hideChaff();
239239
}
240240

241+
// Only rerender the toolbox when the blocks are visible and the xml is
242+
// different from the previously rendered toolbox xml.
243+
// Do not check against prevProps.toolboxXML because that may not have been rendered.
244+
if (
245+
this.props.isVisible &&
246+
this.props.toolboxXML !== this._renderedToolboxXML
247+
) {
248+
this.requestToolboxUpdate();
249+
}
250+
241251
if (this.props.isVisible === prevProps.isVisible) {
242252
if (this.props.stageSize !== prevProps.stageSize) {
243253
// force workspace to redraw for the new stage size

0 commit comments

Comments
 (0)