From 6ae790f2c5ffe48a5ab4195551b4a1bd87e5b437 Mon Sep 17 00:00:00 2001 From: NimBold Date: Wed, 22 Jul 2026 14:50:32 +0330 Subject: [PATCH] fix(ui): restore download table sorting --- src/components/DownloadTable.tsx | 22 ++++++++++++---------- src/index.css | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/components/DownloadTable.tsx b/src/components/DownloadTable.tsx index 5cdcfa4..0944f75 100644 --- a/src/components/DownloadTable.tsx +++ b/src/components/DownloadTable.tsx @@ -314,6 +314,18 @@ export const DownloadTable: React.FC = ({ filter }) => { if (distance < 5) return; gesture.active = true; suppressHeaderClickRef.current = true; + const captureTarget = columnDragCaptureTargetRef.current; + if (captureTarget) { + try { + // Delay capture until the gesture is a real drag. A click on the + // sortable header button must retain its original target so the + // browser can dispatch the button click normally. + captureTarget.setPointerCapture(pointerId); + } catch { + // Window listeners below still handle browsers that reject capture + // after the pointer has already been cancelled. + } + } const target = columnDragTargetRef.current; const rect = target?.getBoundingClientRect(); if (!rect) return; @@ -372,16 +384,6 @@ export const DownloadTable: React.FC = ({ filter }) => { columnDragTargetRef.current = target; columnDragCaptureTargetRef.current = captureTarget; columnDragCapturePointerIdRef.current = pointerId; - if (captureTarget) { - try { - // Capture on the stable grid parent, never on a column that is - // structurally moved during the live reorder. - captureTarget.setPointerCapture(pointerId); - } catch { - // Window listeners below still handle browsers that reject capture - // after the pointer has already been cancelled. - } - } columnDragLayoutRef.current = null; dragGestureRef.current = { key, diff --git a/src/index.css b/src/index.css index 6ba9abb..33dd68f 100644 --- a/src/index.css +++ b/src/index.css @@ -1956,7 +1956,7 @@ html[data-list-density="relaxed"] { color: inherit; font: inherit; text-align: inherit; - cursor: inherit; + cursor: pointer; } .download-column-header-content > span {