Skip to content

feat: Add touch event support for drag-and-drop on mobile devices#17

Merged
StuartF303 merged 1 commit intomainfrom
claude/camper-van-control-setup-011CUpsFKnx2JFyoEDjhfgbz
Nov 11, 2025
Merged

feat: Add touch event support for drag-and-drop on mobile devices#17
StuartF303 merged 1 commit intomainfrom
claude/camper-van-control-setup-011CUpsFKnx2JFyoEDjhfgbz

Conversation

@StuartF303
Copy link
Copy Markdown
Owner

  • Add @ontouchstart, @ontouchmove, and @ontouchend event handlers to overlay items
  • Add touch event handlers to diagram-area container
  • Implement OnTouchStart, OnTouchMove, and OnTouchEnd methods
  • Use touch.ClientX/ClientY for position tracking (same logic as mouse events)
  • Add touch-action: none CSS to prevent scrolling during drag
  • Add preventDefault to prevent default touch behaviors in edit mode

Touch events work alongside mouse events, so drag-and-drop now works on:

  • Desktop (mouse)
  • iPad/iOS (touch)
  • Android tablets/phones (touch)
  • Touchscreen laptops (both)

- Add @ontouchstart, @ontouchmove, and @ontouchend event handlers to overlay items
- Add touch event handlers to diagram-area container
- Implement OnTouchStart, OnTouchMove, and OnTouchEnd methods
- Use touch.ClientX/ClientY for position tracking (same logic as mouse events)
- Add touch-action: none CSS to prevent scrolling during drag
- Add preventDefault to prevent default touch behaviors in edit mode

Touch events work alongside mouse events, so drag-and-drop now works on:
- Desktop (mouse)
- iPad/iOS (touch)
- Android tablets/phones (touch)
- Touchscreen laptops (both)
@StuartF303 StuartF303 merged commit fdda7e5 into main Nov 11, 2025
4 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