From 44051236590925a1916c74416b5cec9d16047ab1 Mon Sep 17 00:00:00 2001 From: rupato-deriv <97010868+rupato-deriv@users.noreply.github.com> Date: Tue, 24 Sep 2024 11:59:29 +0800 Subject: [PATCH] fix: maximum call stack exceeded (#16865) --- packages/bot-skeleton/src/scratch/hooks/gesture.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/bot-skeleton/src/scratch/hooks/gesture.js b/packages/bot-skeleton/src/scratch/hooks/gesture.js index aa3a74e86f65..a917e446c26f 100644 --- a/packages/bot-skeleton/src/scratch/hooks/gesture.js +++ b/packages/bot-skeleton/src/scratch/hooks/gesture.js @@ -23,6 +23,12 @@ Blockly.Gesture.prototype.updateIsDraggingFromFlyout = function () { Blockly.Events.setGroup(true); } + // This is done because when this flag is set to true inside Blockly, + // the handleMove function is called, which also triggers handleTouchMove + // if the flag is false. This method wont be called everything will be handled in handleMove. + const is_mobile = window.innerWidth < 768; + if (is_mobile) this.isMultiTouch_ = false; + // The start block is no longer relevant, because this is a drag. this.startBlock.workspace.clearGesture(); this.startBlock = null;