From 5aa8bab22ffca13325a288f1b8a174ef7880cdcf Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Wed, 30 Jun 2021 17:40:00 +0000 Subject: [PATCH 1/2] Work around WebKit bug that prevents scrolling/zooming the workspace. --- core/workspace_svg.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 95618dbef..3ec92848e 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -877,6 +877,10 @@ Blockly.WorkspaceSvg.prototype.createDom = function(opt_backgroundClass) { if (!this.isFlyout) { Blockly.browserEvents.conditionalBind( this.svgGroup_, 'mousedown', this, this.onMouseDown_, false, true); + // This no-op works around https://bugs.webkit.org/show_bug.cgi?id=226683, + // which otherwise prevents zoom/scroll events from being observed in + // Safari. Once that bug is fixed it should be removed. + document.body.addEventListener('wheel', function(e) {}); Blockly.browserEvents.conditionalBind( this.svgGroup_, 'wheel', this, this.onMouseWheel_); } From c163a768078d6c3ee80d0f4f316ac36a2bd4717b Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Wed, 30 Jun 2021 17:52:17 +0000 Subject: [PATCH 2/2] Removed unused event argument. --- core/workspace_svg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 3ec92848e..c5478ed12 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -880,7 +880,7 @@ Blockly.WorkspaceSvg.prototype.createDom = function(opt_backgroundClass) { // This no-op works around https://bugs.webkit.org/show_bug.cgi?id=226683, // which otherwise prevents zoom/scroll events from being observed in // Safari. Once that bug is fixed it should be removed. - document.body.addEventListener('wheel', function(e) {}); + document.body.addEventListener('wheel', function() {}); Blockly.browserEvents.conditionalBind( this.svgGroup_, 'wheel', this, this.onMouseWheel_); }