Merge pull request #2286 from BeksOmega/fixes/AddHideChaffToDocument

Fixes Block Input Sticking to the Screen When Navigated Away
This commit is contained in:
Rachel Fenichel
2019-02-22 14:19:11 -08:00
committed by GitHub
2 changed files with 5 additions and 0 deletions

View File

@@ -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));

View File

@@ -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,