Skip to content

Commit 800641d

Browse files
gonfunkosebjacobs
authored andcommitted
fix: partially roll back flyout optimization (scratchfoundation#25)
1 parent dd60d16 commit 800641d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

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)