Browse Source

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.
MHSanaei 1 day ago
parent
commit
21058eb63c
1 changed files with 3 additions and 3 deletions
  1. 3 3
      frontend/src/pages/xray/RoutingTab.vue

+ 3 - 3
frontend/src/pages/xray/RoutingTab.vue

@@ -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;
 }