From 8f96f0362366394a188b2f7451faf4b48da85433 Mon Sep 17 00:00:00 2001 From: jdpaterson Date: Wed, 28 Oct 2020 14:14:14 -0700 Subject: [PATCH] call preventDefault only on touchmove --- camera.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/camera.js b/camera.js index 3ce0bed..b12d05d 100644 --- a/camera.js +++ b/camera.js @@ -190,23 +190,17 @@ function createCamera(element, options) { var xy = mouseOffset(ev.changedTouches[0], element) handleInteraction(0, xy[0], xy[1], camera._lastMods) handleInteraction(1, xy[0], xy[1], camera._lastMods) - - ev.preventDefault() - }, hasPassive ? {passive: false} : false) + }, hasPassive ? {passive: true} : false) element.addEventListener('touchmove', function (ev) { var xy = mouseOffset(ev.changedTouches[0], element) handleInteraction(1, xy[0], xy[1], camera._lastMods) - ev.preventDefault() }, hasPassive ? {passive: false} : false) element.addEventListener('touchend', function (ev) { - handleInteraction(0, camera._lastX, camera._lastY, camera._lastMods) - - ev.preventDefault() - }, hasPassive ? {passive: false} : false) + }, hasPassive ? {passive: true} : false) function handleInteraction (buttons, x, y, mods) { var keyBindingMode = camera.keyBindingMode