From 4c0b6de712981929f923d43f51ccd49823a9b256 Mon Sep 17 00:00:00 2001 From: Aculix Technologies Date: Sun, 16 Aug 2026 00:13:50 +0530 Subject: [PATCH] fix: pointer-events reordering with touch and keyboard support HTML5 drag events never fire on touch, so reordering only ever worked with a mouse. Pointer events handle mouse, touch and pen in one path. The entry condition has to differ: a mouse drag starts after 8px of movement, but a touch drag can't use movement, because a vertical swipe on a list usually means scroll. Touch starts on a 400ms long press instead, and moving before that cancels it and lets the page scroll. touch-action applies only while a drag is live, plus a non-passive touchmove blocker, since touch-action can't stop a gesture already in flight. Alt+Up and Alt+Down reorder from the keyboard. Focus is put back on the moved row by hand, since list reconciliation drops it and the first version only worked once. Also removes dataTransfer.setData('text/html', event.target), which passed a DOM node where a string was required. --- src/App.svelte | 149 +++++++++++++++++++++++++++++++++++++++++-------- src/style.css | 4 ++ 2 files changed, 131 insertions(+), 22 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 1c78e9a..da00251 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,5 +1,5 @@