No card flicker during sort: body.wt-sorting freezes item transitions; hover lift gated behind @media (hover:hover)

Touch no longer triggers the hover lift (which flickered while dragging), and
transitions/hover-transform on sortable items are frozen during an active drag.
This commit is contained in:
Asger Geel Weirsøe
2026-06-14 19:25:00 +02:00
parent b70a65d39e
commit 437b4fadd2
3 changed files with 17 additions and 5 deletions
+4
View File
@@ -78,11 +78,13 @@
el.addEventListener('dragstart', function (e) {
dragEl = el;
el.classList.add('wt-dragging');
document.body.classList.add('wt-sorting');
e.dataTransfer.effectAllowed = 'move';
cleanDragImage(el, e);
});
el.addEventListener('dragend', function () {
el.classList.remove('wt-dragging');
document.body.classList.remove('wt-sorting');
dragEl = null;
persist(container);
});
@@ -129,6 +131,7 @@
if (holdTimer) { clearTimeout(holdTimer); holdTimer = null; }
if (clone && clone.parentNode) clone.parentNode.removeChild(clone);
clone = null;
document.body.classList.remove('wt-sorting');
if (lifted && touchEl) { touchEl.classList.remove('wt-dragging'); persist(container); }
lifted = false; touchEl = null; stopScroll();
}
@@ -142,6 +145,7 @@
holdTimer = setTimeout(function () {
lifted = true; touchEl = el;
el.classList.add('wt-dragging');
document.body.classList.add('wt-sorting');
makeClone(el, t.clientX, t.clientY);
if (navigator.vibrate) navigator.vibrate(12);
startScroll();