fix: reset gesture state in onFinalize (selection dot left stuck on cancel)#126
Open
vasanth-svg wants to merge 1 commit into
Open
fix: reset gesture state in onFinalize (selection dot left stuck on cancel)#126vasanth-svg wants to merge 1 commit into
vasanth-svg wants to merge 1 commit into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
usePanGestureonly resetsisPanGestureActivein.onEnd(). ButonEnddoes not fire when the pan gesture is cancelled or interrupted — most commonly when the graph is rendered inside aScrollView/FlatListand the parent scroll takes over the pan. When that happensisActivestaystrue, 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
yarn typecheckpasses locally.🤖 Generated with Claude Code