From 21b05d2a69f24f416a9dd8bf6a8bf0bb5497417c Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Fri, 30 Jun 2017 14:51:18 -0700 Subject: [PATCH] Only add a block in the flyout if it is not disabled (#1204) * Only add a block in the flyout if it is not disabled * PR feedback * remove previous fix --- core/gesture.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/gesture.js b/core/gesture.js index 20f5e1451..ba09192cf 100644 --- a/core/gesture.js +++ b/core/gesture.js @@ -605,11 +605,13 @@ Blockly.Gesture.prototype.doFieldClick_ = function() { Blockly.Gesture.prototype.doBlockClick_ = function() { // Block click in an autoclosing flyout. if (this.flyout_ && this.flyout_.autoClose) { - if (!Blockly.Events.getGroup()) { - Blockly.Events.setGroup(true); + if (!this.targetBlock_.disabled) { + if (!Blockly.Events.getGroup()) { + Blockly.Events.setGroup(true); + } + var newBlock = this.flyout_.createBlock(this.targetBlock_); + newBlock.scheduleSnapAndBump(); } - var newBlock = this.flyout_.createBlock(this.targetBlock_); - newBlock.scheduleSnapAndBump(); } else { // Clicks events are on the start block, even if it was a shadow. Blockly.Events.fire(