diff --git a/pxtblocks/composableMutations.ts b/pxtblocks/composableMutations.ts index 276f98d5c21b..d7a53d60e839 100644 --- a/pxtblocks/composableMutations.ts +++ b/pxtblocks/composableMutations.ts @@ -345,9 +345,18 @@ export function initExpandableBlock(info: pxtc.BlocksInfo, b: Blockly.Block, def Blockly.Events.disable(); try { - const nb = Blockly.Xml.domToBlock(shadow, b.workspace); - if (nb) { - input.connection.connect(nb.outputConnection); + let newBlock: Blockly.Block; + if (!b.initialized) { + // use domToBlockInternal so that we don't trigger a render while + // the block is still being initialized + newBlock = Blockly.Xml.domToBlockInternal(shadow, b.workspace); + } + else { + newBlock = Blockly.Xml.domToBlock(shadow, b.workspace); + } + + if (newBlock) { + input.connection.connect(newBlock.outputConnection); } } catch (e) { }