fix(ui): restore download table sorting

This commit is contained in:
NimBold
2026-07-22 14:50:32 +03:30
parent 07efb3667d
commit 6ae790f2c5
2 changed files with 13 additions and 11 deletions
+12 -10
View File
@@ -314,6 +314,18 @@ export const DownloadTable: React.FC<DownloadTableProps> = ({ filter }) => {
if (distance < 5) return; if (distance < 5) return;
gesture.active = true; gesture.active = true;
suppressHeaderClickRef.current = 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 target = columnDragTargetRef.current;
const rect = target?.getBoundingClientRect(); const rect = target?.getBoundingClientRect();
if (!rect) return; if (!rect) return;
@@ -372,16 +384,6 @@ export const DownloadTable: React.FC<DownloadTableProps> = ({ filter }) => {
columnDragTargetRef.current = target; columnDragTargetRef.current = target;
columnDragCaptureTargetRef.current = captureTarget; columnDragCaptureTargetRef.current = captureTarget;
columnDragCapturePointerIdRef.current = pointerId; 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; columnDragLayoutRef.current = null;
dragGestureRef.current = { dragGestureRef.current = {
key, key,
+1 -1
View File
@@ -1956,7 +1956,7 @@ html[data-list-density="relaxed"] {
color: inherit; color: inherit;
font: inherit; font: inherit;
text-align: inherit; text-align: inherit;
cursor: inherit; cursor: pointer;
} }
.download-column-header-content > span { .download-column-header-content > span {