fix: handle touchcancel to prevent stuck gesture state#320
fix: handle touchcancel to prevent stuck gesture state#320AnshuPriya-1 wants to merge 1 commit intoAOSSIE-Org:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR adds touchcancel event handling to prevent stuck drag and pressed input states. The changes extend the TouchArea component props with an onTouchCancel handler and implement handleTouchCancel in useTrackpadGesture hook to reset all gesture, tracking, and pinch state. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I was able to reproduce the issue on a touch-enabled device (mobile browser). Steps:
After this fix:
This behavior is consistent with how touchcancel is expected to work in touch event lifecycle. Tested on:
|
Addressed Issues:
Fixes #75
Description
This PR adds handling for the
touchcancelevent to ensure gesture state is properly reset when touch interactions are interrupted.On mobile and touch devices, interactions may end with
touchcancelinstead oftouchenddue to:Without handling this event, the app could remain in an inconsistent state (e.g., stuck dragging or pressed input).
Functional Verification
Checklist
My PR addresses a single issue, fixes a single bug or makes a single improvement.
My code follows the project's code style and conventions
I have performed a self-review of my own code
I have commented my code, particularly in hard-to-understand areas
If applicable, I have made corresponding changes or additions to the documentation
If applicable, I have made corresponding changes or additions to tests
My changes generate no new warnings or errors
I have joined the discord and I will share a link to this PR with the project maintainers there
Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
Summary by CodeRabbit