From 30fed7fc778560e759ae5602901d898af80e0a28 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 30 Nov 2026 11:34:19 +0100 Subject: fix(todo): a hold on a todo is not cancelled by Android's long press The pointerdown went through without preventDefault, so a long press on the title started Android's context menu or text selection and sent pointercancel before the 800 ms hold fired. hold.js already does this. Co-Authored-By: Claude Opus 5.5 --- static/dashboard.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'static') diff --git a/static/dashboard.js b/static/dashboard.js index 7dbf00c..91ab2ec 100644 --- a/static/dashboard.js +++ b/static/dashboard.js @@ -125,7 +125,11 @@ function gestures(el, { tap, hold, swipe }) { timer = null; x0 = null; sliding = false; el.classList.remove("holding", "sliding"); }; + // Android's long press (context menu, text selection) would cancel the + // pointer before the hold fires; hold.js stops it the same way. + el.addEventListener("contextmenu", (e) => e.preventDefault()); el.addEventListener("pointerdown", (e) => { + e.preventDefault(); x0 = e.clientX; dx = 0; el.setPointerCapture(e.pointerId); el.classList.add("holding"); -- cgit v1.2.3