瀏覽代碼

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 3 周之前
父節點
當前提交
21058eb63c
共有 1 個文件被更改,包括 3 次插入3 次删除
  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;
 }