diff --git a/src/virtual-machine.js b/src/virtual-machine.js index 223620cb3..0e5048f52 100644 --- a/src/virtual-machine.js +++ b/src/virtual-machine.js @@ -353,6 +353,8 @@ class VirtualMachine extends EventEmitter { * @param {!Blockly.Event} e Any Blockly event. */ monitorBlockListener (e) { + // Filter events by type, since monitor blocks only need to listen to these events. + // Monitor blocks shouldn't be destroyed when flyout blocks are deleted. if (['create', 'change'].indexOf(e.type) !== -1) { this.runtime.monitorBlocks.blocklyListen(e, this.runtime); }