Skip to content

fix: reset gesture state in onFinalize (selection dot left stuck on cancel)#126

Open
vasanth-svg wants to merge 1 commit into
margelo:mainfrom
vasanth-svg:fix/reset-gesture-on-cancel
Open

fix: reset gesture state in onFinalize (selection dot left stuck on cancel)#126
vasanth-svg wants to merge 1 commit into
margelo:mainfrom
vasanth-svg:fix/reset-gesture-on-cancel

Conversation

@vasanth-svg

Copy link
Copy Markdown

Summary

usePanGesture only resets isPanGestureActive in .onEnd(). But onEnd does not fire when the pan gesture is cancelled or interrupted — most commonly when the graph is rendered inside a ScrollView / FlatList and the parent scroll takes over the pan. When that happens isActive stays true, so the selection dot / scrub overlay stays visible after the finger has lifted.

.onFinalize() always runs at the end of a gesture (whether it completed or was cancelled), so this resets the active state there too.

Change

         .onEnd(() => {
           isPanGestureActive.value = false;
+        })
+        .onFinalize(() => {
+          isPanGestureActive.value = false;
         }),

One-line behavioural change plus an explanatory comment.

Notes

  • No API change, fully backwards compatible.
  • yarn typecheck passes locally.

🤖 Generated with Claude Code

…t stuck

The pan gesture only resets `isPanGestureActive` in `onEnd`, but `onEnd`
does not fire when the gesture is cancelled or interrupted — most commonly
when the graph is inside a ScrollView / FlatList and the parent scroll takes
over the pan. When that happens `isActive` stays `true`, leaving the
selection dot / scrub overlay visible after the finger has lifted.

`onFinalize` always runs at the end of a gesture (success or cancel), so
reset the active state there as well.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@chrispader chrispader left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thank you!

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