mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
Merge pull request #2286 from BeksOmega/fixes/AddHideChaffToDocument
Fixes Block Input Sticking to the Screen When Navigated Away
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user