Skip to content

[Bug]: Handle touchcancel to prevent stuck drag or pressed input state #75

@g-k-s-03

Description

@g-k-s-03

Bug Description

Issue Description
Summary

The current gesture tracking handles touchstart, touchmove, and touchend, but does not handle touchcancel.
On mobile browsers and touch devices, touch sequences can sometimes end with touchcancel instead of touchend. When this happens, gesture state may not be cleaned up properly.

Why This Matters
If touchcancel occurs and cleanup is not performed:

  • Drag state may remain active
  • Mouse press may remain “held”
  • Gesture tracking may stay in an inconsistent state
  • User may experience stuck dragging or broken input until next interaction reset
    This can occur in real scenarios such as:
  • OS interrupts (notifications, incoming calls)
  • System gestures (home/back swipe, app switch)
  • Browser taking control of scrolling or zooming
  • Loss of window focus

Steps to Reproduce

  1. Open Rein client on a mobile device or touch-enabled browser
  2. Start a drag or gesture interaction (e.g., touch and move)
  3. While touching the screen, trigger an OS or browser interrupt:
    • Pull notification shade
    • Receive a notification overlay
    • Switch apps / trigger system gesture
    • Browser takes control for scroll or zoom
  4. Resume interaction

Result: Gesture or drag state may remain active or input may behave inconsistently.

Expected Behavior

Gesture state should always be safely reset when a touch sequence is interrupted.
If touchcancel occurs, Rein should:

  • Clear active touches
  • Release drag or pressed input state
  • Reset gesture tracking safely

Desktop Operating System

Windows 11

Mobile Device (Client)

Android Chrome

Rein Version

Latest development version

Console Logs / Error Messages

No console errors observed. This appears to be a gesture lifecycle handling issue rather than runtime error.

Checklist

  • I have searched for existing issues to avoid duplicates

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions