Skip to content

Fix Wishlist touch interactions broken on iOS#50

Merged
JoeProgrammer88 merged 2 commits intomainfrom
copilot/fix-wishlist-page-interaction
Mar 21, 2026
Merged

Fix Wishlist touch interactions broken on iOS#50
JoeProgrammer88 merged 2 commits intomainfrom
copilot/fix-wishlist-page-interaction

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 21, 2026

iOS users couldn't interact with Wishlist items (checkbox, Edit button, View Listing link) because the touch drag-and-drop handlers were unconditionally calling e.preventDefault() on every touchmove, suppressing the synthetic click events Safari generates for child elements. Android/Chrome tolerates this; iOS does not.

Changes

  • Deferred drag activation: touchstart no longer immediately sets drag state — it now only records the start position (passive: true)
  • Threshold-gated drag mode: touchmove activates drag mode only after touch displacement exceeds 10px; e.preventDefault() is only called once drag is confirmed active
  • Early exit in touchend: skips all drag/reorder logic when no drag was initiated, letting normal tap events propagate
// Before: drag activated on every touch, preventDefault always called
el.addEventListener('touchstart', () => {
    this.dragSrcWishId = el.dataset.wishId!;
    el.classList.add('dragging');
}, { passive: false });
el.addEventListener('touchmove', (e) => {
    e.preventDefault(); // always suppressed clicks on iOS
    ...
}, { passive: false });

// After: drag only activates after meaningful movement
el.addEventListener('touchstart', (e) => {
    touchStartX = e.touches[0].clientX;
    touchStartY = e.touches[0].clientY;
    touchDragActive = false;
}, { passive: true });
el.addEventListener('touchmove', (e) => {
    const dx = e.touches[0].clientX - touchStartX;
    const dy = e.touches[0].clientY - touchStartY;
    if (!touchDragActive && (dx * dx + dy * dy) > DRAG_THRESHOLD * DRAG_THRESHOLD) {
        touchDragActive = true;
        this.dragSrcWishId = el.dataset.wishId!;
        el.classList.add('dragging');
    }
    if (!touchDragActive) return;
    e.preventDefault(); // only called when actually dragging
    ...
}, { passive: false });

Touch drag-and-drop reordering continues to work as before.

Original prompt

This section details on the original issue you should resolve

<issue_title>Potential Bug</issue_title>
<issue_description>A couple users are reporting that their Wishlist page cannot be interacted with. The checkbox to complete a wish list item, the edit button, and the View Listing buttons are not responding. The rest of the app is working fine. Currently iPhone users are reporting a problem but an Android user says the Wish List page is working</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

The touchstart handler was immediately entering drag mode and the
touchmove handler unconditionally called preventDefault(), which
suppressed synthetic click events on iOS/Safari for child elements
(checkbox, edit button, View Listing link).

Fix: only activate drag mode when touch moves beyond a 10px threshold,
only call preventDefault() when drag mode is active, and skip drag
logic in touchend when no drag was initiated. touchstart is now
passive:true since we no longer call preventDefault() there.

Co-authored-by: JoeProgrammer88 <7156063+JoeProgrammer88@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SpeakingInBits/TaskManagerWeb/sessions/e94c6188-f1fa-4385-ad79-c8a2282534f0
Copilot AI changed the title [WIP] Fix interaction issues on Wishlist page Fix Wishlist touch interactions broken on iOS Mar 21, 2026
Copilot AI requested a review from JoeProgrammer88 March 21, 2026 01:51
@JoeProgrammer88 JoeProgrammer88 marked this pull request as ready for review March 21, 2026 01:53
@JoeProgrammer88 JoeProgrammer88 merged commit 667a130 into main Mar 21, 2026
1 check passed
@JoeProgrammer88 JoeProgrammer88 deleted the copilot/fix-wishlist-page-interaction branch March 21, 2026 01:57
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.

Potential Bug

2 participants