Skip to content

fix: Improve text selection detection on iOS Safari#389

Merged
rjroy merged 1 commit intomainfrom
fix/select
Jan 21, 2026
Merged

fix: Improve text selection detection on iOS Safari#389
rjroy merged 1 commit intomainfrom
fix/select

Conversation

@rjroy
Copy link
Copy Markdown
Owner

@rjroy rjroy commented Jan 21, 2026

Summary

  • Added touchend event listener with 10ms delay to catch iOS touch-based text selection
  • Added document.selectionchange listener for textareas (iOS Safari fires this for textarea selections, not just contenteditable)
  • Selection change handler only fires when the textarea is focused to avoid unnecessary processing

Test plan

  • Test text selection on iOS Safari in Pair Writing mode
  • Verify selection notifications are received consistently
  • Verify desktop selection behavior is unchanged

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

iOS Safari fires selection events differently than desktop browsers.
Added touchend listener with delay for touch-based selection, and
document selectionchange listener for textareas (not just contenteditable).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rjroy rjroy merged commit d768622 into main Jan 21, 2026
2 checks passed
@rjroy rjroy deleted the fix/select branch January 21, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant