fix(routing): make rule drag-and-drop work on mobile cards
The pointermove handler looked up the drop target via
el.closest('tr[data-row-key]'). That selector only matches the
desktop a-table rows; the mobile branch renders each rule as a
<div class="rule-card" data-row-key>, so on phones the lookup
always returned null, dropTargetIndex stayed pinned to the start
index, and the eventual drop was a no-op. Loosened the selector
to [data-row-key] so both DOM shapes resolve.
This commit is contained in:
@@ -188,9 +188,9 @@ function onDragPointerMove(ev) {
|
||||
dragMoved = true;
|
||||
const el = document.elementFromPoint(ev.clientX, ev.clientY);
|
||||
if (!el) return;
|
||||
const tr = el.closest('tr[data-row-key]');
|
||||
if (!tr) return;
|
||||
const idx = Number(tr.getAttribute('data-row-key'));
|
||||
const target = el.closest('[data-row-key]');
|
||||
if (!target) return;
|
||||
const idx = Number(target.getAttribute('data-row-key'));
|
||||
if (Number.isFinite(idx)) dropTargetIndex.value = idx;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user