From b4fdd3c775c1749027ce1ccfb2dbd42a4a7f7643 Mon Sep 17 00:00:00 2001 From: Chris Garrity Date: Tue, 10 Mar 2020 11:57:17 -0400 Subject: [PATCH] Change touchmove handling in editor to prevent scrolling whole window on iOS Fixes #217 Testing: - verify still works on Android - check anywhere that could scroll: - character or backdrop library - projects in lobby - help documentation - blocks pallette - --- src/editor/ScratchJr.js | 3 --- src/editor/ui/Scripts.js | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/editor/ScratchJr.js b/src/editor/ScratchJr.js index 9bb7a32..f1b35cc 100644 --- a/src/editor/ScratchJr.js +++ b/src/editor/ScratchJr.js @@ -226,9 +226,6 @@ export default class ScratchJr { static editorEvents () { document.ongesturestart = undefined; - document.ontouchmove = function (e) { - e.preventDefault(); - }; window.ontouchstart = ScratchJr.unfocus; if (isTablet) { window.ontouchend = undefined; diff --git a/src/editor/ui/Scripts.js b/src/editor/ui/Scripts.js index 4ff12a1..a367ef6 100644 --- a/src/editor/ui/Scripts.js +++ b/src/editor/ui/Scripts.js @@ -93,6 +93,7 @@ export default class Scripts { // It seems to have been checking if the drag was on the invisible shadow of the repeat block // It's not clear to me why we would want this, and seems functional without it. -- TM //if ((ths.owner.blocktype == "repeat") && !hitTest(ths.childNodes[1], pixel)) continue; + e.preventDefault(); Events.startDrag(e, ths, ScriptsPane.prepareToDrag, ScriptsPane.dropBlock, ScriptsPane.draggingBlock, ScriptsPane.runBlock); return;