From 8bc857d54fbe867256cffe382a947870096d1140 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Tue, 29 Dec 2020 16:32:50 +0900 Subject: [PATCH] feat: handle touchstart fix: event.preventDefault() error --- src/main.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 7f6b2df..b9d6c23 100644 --- a/src/main.ts +++ b/src/main.ts @@ -110,7 +110,8 @@ function main() { renderer.setSize(window.innerWidth, window.innerHeight); Object.assign(canvas.style, { width: "100%", height: "100%" }); root.addEventListener("keydown", handleKeydown); - root.addEventListener("touchmove", handleTouchmove); + root.addEventListener("touchstart", handleTouchmove, { passive: false }); + root.addEventListener("touchmove", handleTouchmove, { passive: false }); root.addEventListener("keyup", handleMouseMoveEnd); root.addEventListener("touchend", handleMouseMoveEnd); root.addEventListener("mousedown", () => {