commit eed3e782975afb48c5ab787df35fa2de2fe12f06
parent 39936cf641b86cd24236d792d963db4638296269
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Thu, 31 Oct 2024 12:21:10 -0700
Fix default touch actions on touch devices
This should prevent unexpectedly selecting parts of the page when
holding down a press on touch devices. At the very least this fixes
iOS (unfortunately my Android is out of commission).
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/files/floorplans/floorplan/main.js b/files/floorplans/floorplan/main.js
@@ -260,6 +260,9 @@ function run(editor) {
editor.fitToView()
})
+ document.querySelector("header")
+ .addEventListener("touchstart", function(e) { e.preventDefault() })
+ editor.draw.on("touchstart", function(e){ e.preventDefault() });
editor.draw.on("touchmove", function(e){ e.preventDefault() });
editor.draw.on("pinchZoomStart", function() { State.panZoom |= zoomBit })
editor.draw.on("pinchZoomEnd", function() { State.panZoom &= ~zoomBit})