From 63c899e4e1a0476427935067bbc21ec4ff01b23e Mon Sep 17 00:00:00 2001 From: picklesrus Date: Mon, 6 Mar 2017 16:19:29 -0800 Subject: [PATCH] Potential fix for #888. Stops checking whether we are mid workspace drag since we do not always get mosue up events when blockly is in an iframe. (#899) --- core/workspace_svg.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 0d68216f9..c3dc66972 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -683,6 +683,15 @@ Blockly.WorkspaceSvg.prototype.setupDragSurface = function() { return; } + // This can happen if the user starts a drag, mouses up outside of the + // document where the mouseup listener is registered (e.g. outside of an + // iframe) and then moves the mouse back in the workspace. On mobile and ff, + // we get the mouseup outside the frame. On chrome and safari desktop we do + // not. + if (this.isDragSurfaceActive_) { + return; + } + this.isDragSurfaceActive_ = true; // Figure out where we want to put the canvas back. The order