From 64748bd76da61a9d233923e9ad3de9f4d41b3b7b Mon Sep 17 00:00:00 2001 From: Carter Date: Wed, 4 Jun 2025 10:55:14 -0600 Subject: [PATCH] using a loop to determine the next table cell to shrink --- src/common/ResponsiveTable.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/ResponsiveTable.tsx b/src/common/ResponsiveTable.tsx index a26cfe4..b60f6af 100644 --- a/src/common/ResponsiveTable.tsx +++ b/src/common/ResponsiveTable.tsx @@ -471,7 +471,14 @@ export default function ResponsiveTable(props: Props) { let newWidths: number[] = [...rowWidths] newWidths[index] = newWidths[index] - (dragStart - e.clientX) - newWidths[index+1] = newWidths[index+1] + (dragStart - e.clientX) + // newWidths[index+1] = newWidths[index+1] + (dragStart - e.clientX) + newWidths.every((width, j) => { + if (j <= index || width === 0) return true + else if (newWidths[j] !== undefined) { + newWidths[j] = newWidths[j] + (dragStart - e.clientX) + return false + } + }) setRowWidths(newWidths) }