From 83111bf3910d0af5cd268a74fb2a5540098d55eb Mon Sep 17 00:00:00 2001 From: Joshua Chudy Date: Thu, 14 Dec 2023 09:55:27 -0800 Subject: [PATCH] add timeout and only remove sensor in a very specific ase --- src/components/recordset/table-row.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/recordset/table-row.tsx b/src/components/recordset/table-row.tsx index 811c14860..63ebc0538 100644 --- a/src/components/recordset/table-row.tsx +++ b/src/components/recordset/table-row.tsx @@ -146,7 +146,8 @@ const TableRow = ({ return overflow === true }); - if (sensor && justOverflows.length === 0) sensor.detach(); + // add length check so this only triggers for the reason from the above comment + if (sensor && rowValues.length === 1 && justOverflows.length === 0) sensor.detach(); } // TODO: This assumes that tuple is set before rowValues. And that useEffect triggers before useLayoutEffect @@ -160,9 +161,10 @@ const TableRow = ({ if (!rowContainer.current || disableMaxRowHeightFeature) return; const tempSensor = new ResizeSensor( rowContainer.current, - () => { - initializeOverflows(); - } + () => setTimeout(() => { + initializeOverflows() + // images take ~200ms to load so wait at least that long before running + }, 200) ) setSensor(tempSensor);