Skip to content

fix: use DragStartBehavior.down for free text-drag selection#666

Closed
goccd wants to merge 1 commit into
espresso3389:masterfrom
coco-de:fix/drag-start-anchor
Closed

fix: use DragStartBehavior.down for free text-drag selection#666
goccd wants to merge 1 commit into
espresso3389:masterfrom
coco-de:fix/drag-start-anchor

Conversation

@goccd

@goccd goccd commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #665

The text selection GestureDetector used the default DragStartBehavior.start,
so onPanStart reported the post-slop position (~kTouchSlop, 18px). Free
text-drag selection therefore began 1-2 characters after the touch-down on
touch devices (notably iPad/tablets), skipping the first character(s).

Setting dragStartBehavior: DragStartBehavior.down makes onPanStart report
the original pointer-down position, so selection starts exactly where the
user pressed.

Changes

  • packages/pdfrx/lib/src/widgets/pdf_viewer.dart: set
    dragStartBehavior: DragStartBehavior.down on the free text-drag selection
    GestureDetector.

The text selection GestureDetector used the default DragStartBehavior.start,
so onPanStart reported the post-slop position (~kTouchSlop, 18px). Free
text-drag selection therefore began 1-2 characters after the touch-down on
touch devices (notably iPad/tablets), skipping the first character(s).

Setting dragStartBehavior: DragStartBehavior.down makes onPanStart report the
original pointer-down position, so selection starts exactly where the user
pressed.

Refs: espresso3389#665
@goccd goccd force-pushed the fix/drag-start-anchor branch from 72f55e6 to 289b269 Compare July 2, 2026 04:43
@goccd goccd closed this Jul 2, 2026
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.

Free text-drag selection skips the first 1–2 characters on touch devices

1 participant