Skip to content

fix(terminal): require touch slop before starting finger scroll - #255

Merged
itsvks19 merged 1 commit into
klyx-dev:mainfrom
ulite-Amr:fix/scroll-touch-slop
Aug 31, 2026
Merged

fix(terminal): require touch slop before starting finger scroll#255
itsvks19 merged 1 commit into
klyx-dev:mainfrom
ulite-Amr:fix/scroll-touch-slop

Conversation

@ulite-Amr

@ulite-Amr ulite-Amr commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Problem

Modifier.scroll started scrolling on the first drag event with no touch-slop gate. Effects:

  • Accidental micro-movements / finger jitter scrolled the terminal.
  • dragEvent.consume() ran on every move event (even sub-pixel drift from a still finger). Compose's tap detector cancels long-press when movement is consumed by another gesture, so long-press to select text was unreliable — any drift during the hold canceled it.

Additionally, previousPosition was never updated while selectionState.isActive; if selection deactivated mid-gesture, the first scroll frame used a stale position and jumped a large delta.

Fix

  • Gate finger scrolling behind passedTouchSlop (viewConfiguration.touchSlop), matching the standard drag-gesture arbitration used by detectDragGestures.
  • Only consume movement past the slop — a still finger no longer has its long-press interrupted, so long-press text selection now fires reliably.
  • Keep previousPosition in sync during selectionState.isActive, so a selection drag that becomes a scroll starts with a fresh delta (no jump).

Verification

Finger scrolling, long-press selection, and selection-handle drags tested on-device via a signed release build from the fork's CI.

@itsvks19
itsvks19 merged commit 5cf8f7b into klyx-dev:main Aug 31, 2026
2 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.

2 participants