Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Uncaught Error Couldn't clear and hide the drag surface (#5759) #5760

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions core/workspace_svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,16 @@ Blockly.WorkspaceSvg.prototype.resetDragSurface = 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 and
// hover directly over the scrollbar, click once on the scrollbar,
// and then click on the workspace.
if (!this.isDragSurfaceActive_) {
console.warn('Tried to reset workspace drag surface twice.');
return;
}

this.isDragSurfaceActive_ = false;

var trans = this.workspaceDragSurface_.getSurfaceTranslation();
Expand Down