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 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-04-03 14:35:45 -07:00
parent d4612d6fb8
commit 0337797b7c
1 changed files with 3 additions and 1 deletions

View File

@ -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));