mirror of
https://github.com/aculix/negotium.git
synced 2026-09-11 07:28:17 +00:00
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.
This commit is contained in:
@@ -276,6 +276,10 @@ body {
|
||||
.task-item.dragging {
|
||||
opacity: 0.4;
|
||||
cursor: grabbing;
|
||||
/* Only while a drag is actually in flight, so an ordinary touch on a row
|
||||
still scrolls the page. */
|
||||
touch-action: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.task-item.drag-over::before {
|
||||
|
||||
Reference in New Issue
Block a user