From 0337797b7cdc42919c69f58930d4be0402834cee Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Fri, 3 Apr 2026 14:35:45 -0700 Subject: [PATCH] fix(rtime): enable touch drag for commitment pool orbs on mobile Add touch-action:none on canvas and preventDefault on pointerdown to prevent the browser from claiming touch events for scroll/pan gestures. Co-Authored-By: Claude Opus 4.6 --- lib/folk-commitment-pool.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/folk-commitment-pool.ts b/lib/folk-commitment-pool.ts index b4499cb..915eedc 100644 --- a/lib/folk-commitment-pool.ts +++ b/lib/folk-commitment-pool.ts @@ -271,6 +271,7 @@ export class FolkCommitmentPool extends FolkShape { if (container) container.replaceWith(this.#wrapper); this.#canvas = this.#wrapper.querySelector("canvas")!; + this.#canvas.style.touchAction = "none"; // prevent browser scroll/pan on touch drag this.#ctx = this.#canvas.getContext("2d")!; this.#canvas.addEventListener("pointermove", this.#onPointerMove); @@ -354,8 +355,9 @@ export class FolkCommitmentPool extends FolkShape { const orb = this.#findOrbAt(x, y); if (!orb) return; - // Prevent FolkShape from starting a shape-move + // Prevent FolkShape from starting a shape-move + browser scroll/pan on touch e.stopPropagation(); + e.preventDefault(); this.#draggingOrb = orb; this.#ripples.push(new Ripple(orb.x, orb.y, orb.color));