feat: Add mobile touch drag-and-drop support#95
feat: Add mobile touch drag-and-drop support#95AndyatFocallocal wants to merge 1 commit intodiscourse:mainfrom
Conversation
|
Is it ok now? |
|
@davidtaylorhq @angusmcleod @cvx How do i get these changes approved and merged, or rejected with feedback? I have other improvements i'd like to add to the component but don't want to start a competing branch. |
|
Hi @AndyatFocallocal, thanks for the PR. Can you explain the reasons for the vanilla-js approach you used in the |
|
@davidtaylorhq Thanks for replying. Yes, you're right about the CSS changes. I'm pretty new to developing with Discourse. I'll update the PR with those. The touch drag modifier uses vanilla JavaScript for performance reasons. The touch events need to fire 60+ times per second during a drag to track finger movement smoothly. Its my understanding that Ember's reactivity system would create noticeable lag because each touch move would trigger a state update then re-render cycle. Manipulating the DOM directly gives instant visual feedback that follows your finger without any delays. Is there a better way to approach that? |
0df5858 to
0f00633
Compare
Adds touch-based drag and drop for mobile devices using a long-press gesture. Features: - Long press (500ms) to pick up a card - Card floats above original position with drop/cancel buttons - Scroll horizontally while dragging to reach other columns - Drop button triggers the move confirmation dialog - Cancel button (X) returns card to original position - Visual feedback with haptic vibration - Login required to drag cards Technical details: - Uses custom touchDrag modifier for touch event handling - Dispatches native drag events for compatibility with existing drop handlers - All styling uses CSS custom properties for theme compatibility - Mobile-only: desktop drag behavior unchanged
0f00633 to
36315ad
Compare
|
I assume this is not going to be accepted into the main repo. I would appreciate some dialogue on what the issue is and how you would have suggested approaching it. I was hoping to contribute more features to this component, but wasn't intending to run and maintain my own fork of it. |
Implements full touch-based drag-and-drop for mobile devices while preserving desktop functionality:
Features:
Mobile UX improvements:
iOS/Android compatibility:
Permissions:
Technical implementation: