From 3f49ee05316f1ee9367ee889a49ff41d1652352e Mon Sep 17 00:00:00 2001 From: Jeremy Scheff Date: Fri, 7 Feb 2025 19:11:23 -0500 Subject: [PATCH] More careful --- TODO | 2 -- src/ui/components/DataTable/sortableRows.tsx | 12 ++++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index a9658c236..06c884055 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,3 @@ -uneven number of games from schedule with 80 games and 60 div games https://discord.com/channels/290013534023057409/290015591216054273/1336156359091163197 - export bug https://discord.com/channels/290013534023057409/290015591216054273/1335186753593802763 show # of teams in each division when making expansion draft https://old.reddit.com/r/BasketballGM/comments/1iingd3/i_added_a_bunch_of_expansion_teams_but_added_too/ diff --git a/src/ui/components/DataTable/sortableRows.tsx b/src/ui/components/DataTable/sortableRows.tsx index 844ef187f..736c9f73a 100644 --- a/src/ui/components/DataTable/sortableRows.tsx +++ b/src/ui/components/DataTable/sortableRows.tsx @@ -75,11 +75,15 @@ export const SortableHandle = ({ const overlayTds = sortableHandleRef.current.parentElement!.children; for (let i = 0; i < overlayTds.length; i++) { - const overlayTd = overlayTds[i] as HTMLTableCellElement; - const tableTd = tableTds[i] as HTMLTableCellElement; + const overlayTd = overlayTds[i] as HTMLTableCellElement | undefined; + if (overlayTd) { + const tableTd = tableTds[i] as HTMLTableCellElement | undefined; - overlayTd.style.width = `${tableTd.offsetWidth}px`; - overlayTd.style.padding = "4px"; + if (tableTd) { + overlayTd.style.width = `${tableTd.offsetWidth}px`; + } + overlayTd.style.padding = "4px"; + } } } }, [overlay, tableRef]);