Skip to content

Conversation

@vinguyen12
Copy link
Contributor

@vinguyen12 vinguyen12 commented Sep 12, 2025

Add Touch Plugin, Pointer Event type (pointer up, pointer down).

Use DomEventPlugin to recognize pointer event and trigger newly created pointer plugin event. Touch Plugin event will be used to handle cursor selection for text.

(Spec: For touch selection, move the cursor to the beginning or end of the word if they tap within 6 characters of the beginning/end. If not, then place the cursor where they originally tapped.)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements touch selection repositioning behavior to improve text cursor placement on touch devices. When users tap within 6 characters of a word's beginning or end, the cursor moves to the nearest word boundary; otherwise, it remains at the original tap position.

Key changes:

  • Add new repositionTouchSelection function with word boundary detection logic
  • Integrate touch selection handling into the SelectionPlugin with timeout delay
  • Export the adjustWordSelection utility function for reuse

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
repositionTouchSelection.ts New module implementing touch selection repositioning logic with 6-character threshold
SelectionPlugin.ts Integration of touch selection handler with 200ms timeout and import addition
index.ts Export of adjustWordSelection utility function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@vinguyen12 vinguyen12 changed the title Add repositionTouchSelection handler Add TouchPlugin to handle text selection by touch Sep 12, 2025
@vinguyen12 vinguyen12 merged commit 7799ead into master Sep 16, 2025
7 checks passed
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.

3 participants