Skip to content

Avoid iOS Safari pointer capture exceptions on new sketch canvas#1

Open
dwwoelfel wants to merge 1 commit intomainfrom
codex/investigate-drawing-issue-on-iphones
Open

Avoid iOS Safari pointer capture exceptions on new sketch canvas#1
dwwoelfel wants to merge 1 commit intomainfrom
codex/investigate-drawing-issue-on-iphones

Conversation

@dwwoelfel
Copy link
Collaborator

Motivation

  • Investigated drawing failures on iPhones and verified stream readers use getReader() + await reader.read() loops rather than for await...of, so async-iteration-on-streams is not the cause.
  • Found unconditional setPointerCapture / releasePointerCapture calls on the new-sketch canvas which can throw on some iOS Safari touch pointers and break input handling.

Description

  • Added safelySetPointerCapture and safelyReleasePointerCapture helpers that feature-detect and wrap setPointerCapture/releasePointerCapture in try/catch to avoid exceptions.
  • Replaced direct e.currentTarget.setPointerCapture(e.pointerId) and e.currentTarget.releasePointerCapture(e.pointerId) calls with the safe wrappers in src/app/new/page.tsx.
  • Left stream consumption unchanged, continuing to use ReadableStream.getReader() + reader.read() loops which are Safari-compatible.

Testing

  • Ran pnpm -s eslint src/app/new/page.tsx which passed.
  • Ran pnpm -s tsc --noEmit which passed.

Codex Task

@vercel
Copy link

vercel bot commented Mar 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
inkdot Ready Ready Preview, Comment Mar 6, 2026 3:19pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant