Description
When using free text-drag selection (i.e. dragging directly on the PDF text without first activating selection handles), the selection starts 1–2 characters after the actual touch-down point on touch devices — most noticeably on iPad/tablets.
Root cause
The GestureDetector used for text-drag selection in pdf_viewer.dart relies on the default DragStartBehavior.start, which reports the position in onPanStart only after the touch has moved past the platform's touch slop (kTouchSlop, ~18px). On touch devices this means the reported drag-start position is already 1–2 characters past where the user actually pressed down, so the selection anchor skips the first character(s).
Suggested fix
Set dragStartBehavior: DragStartBehavior.down on that GestureDetector so onPanStart reports the original pointer-down position instead of the post-slop position. This makes the selection start exactly where the user pressed.
Affected file
packages/pdfrx/lib/src/widgets/pdf_viewer.dart — the GestureDetector wrapping onPanStart/onPanUpdate/onPanEnd for free text-drag selection.
I'll open a PR with this fix shortly.
Description
When using free text-drag selection (i.e. dragging directly on the PDF text without first activating selection handles), the selection starts 1–2 characters after the actual touch-down point on touch devices — most noticeably on iPad/tablets.
Root cause
The
GestureDetectorused for text-drag selection inpdf_viewer.dartrelies on the defaultDragStartBehavior.start, which reports the position inonPanStartonly after the touch has moved past the platform's touch slop (kTouchSlop, ~18px). On touch devices this means the reported drag-start position is already 1–2 characters past where the user actually pressed down, so the selection anchor skips the first character(s).Suggested fix
Set
dragStartBehavior: DragStartBehavior.downon thatGestureDetectorsoonPanStartreports the original pointer-down position instead of the post-slop position. This makes the selection start exactly where the user pressed.Affected file
packages/pdfrx/lib/src/widgets/pdf_viewer.dart— theGestureDetectorwrappingonPanStart/onPanUpdate/onPanEndfor free text-drag selection.I'll open a PR with this fix shortly.