From ab09241289ba1dd67f400c3446b6077a291dd8ca Mon Sep 17 00:00:00 2001 From: LordCat Date: Sat, 6 Dec 2025 12:50:43 -0500 Subject: [PATCH] Don't send blockly events when loading/clearing the workspace --- core/xml.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/xml.js b/core/xml.js index 1897a558d3..dd2b529b89 100644 --- a/core/xml.js +++ b/core/xml.js @@ -406,10 +406,13 @@ Blockly.Xml.textToDom = function(text) { * @return {Array.} An array containing new block ids. */ Blockly.Xml.clearWorkspaceAndLoadFromXml = function(xml, workspace) { + var wasEventsEnabled = Blockly.Events.isEnabled(); + Blockly.Events.disable(); workspace.setResizesEnabled(false); workspace.setToolboxRefreshEnabled(false); workspace.clear(); var blockIds = Blockly.Xml.domToWorkspace(xml, workspace); + if (wasEventsEnabled) Blockly.Events.enable(); workspace.setResizesEnabled(true); workspace.setToolboxRefreshEnabled(true); return blockIds;