diff --git a/core/inject.js b/core/inject.js index 6a875dbc1..7a89b8cb9 100644 --- a/core/inject.js +++ b/core/inject.js @@ -437,6 +437,10 @@ Blockly.init_ = function(mainWorkspace) { */ Blockly.inject.bindDocumentEvents_ = function() { if (!Blockly.documentEventsBound_) { + Blockly.bindEventWithChecks_(document, 'mousedown', null, function() { + Blockly.hideChaff(); + Blockly.Touch.clearTouchIdentifier(); // Don't block future drags. + }); Blockly.bindEventWithChecks_(document, 'scroll', null, Blockly.mainWorkspace.updateInverseScreenCTM .bind(Blockly.mainWorkspace)); diff --git a/core/toolbox.js b/core/toolbox.js index 8c49c360c..4047c729c 100644 --- a/core/toolbox.js +++ b/core/toolbox.js @@ -171,6 +171,7 @@ Blockly.Toolbox.prototype.init = function() { Blockly.hideChaff(true); } Blockly.Touch.clearTouchIdentifier(); // Don't block future drags. + e.stopPropagation(); // Don't let the document handle this event. }, /*opt_noCaptureIdentifier*/ false, /*opt_noPreventDefault*/ true); var workspaceOptions = { disabledPatternId: workspace.options.disabledPatternId,