aboutsummaryrefslogtreecommitdiffstats
path: root/static/dashboard.js
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-30 11:34:19 +0100
committerDanilo M. <danix@danix.xyz>2026-11-30 11:34:19 +0100
commit30fed7fc778560e759ae5602901d898af80e0a28 (patch)
tree83b4651ada7c5547fee1a5fcd0bb432f5ba69d6c /static/dashboard.js
parent88d56032c2ea5cf0ca525667f91eadc1cd63333c (diff)
downloaddeck-it-30fed7fc778560e759ae5602901d898af80e0a28.tar.gz
deck-it-30fed7fc778560e759ae5602901d898af80e0a28.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'static/dashboard.js')
-rw-r--r--static/dashboard.js4
1 files changed, 4 insertions, 0 deletions
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");