diff --git a/src/table/hooks/useFixed.ts b/src/table/hooks/useFixed.ts index 70fd03d5f..36b054747 100644 --- a/src/table/hooks/useFixed.ts +++ b/src/table/hooks/useFixed.ts @@ -271,7 +271,7 @@ export default function useFixed( defaultBottom = thead?.getBoundingClientRect().height || 0; } thisRowInfo.top = (lastRowInfo.top || defaultBottom) + (lastRowInfo.height || 0); - initialColumnMap.set(rowId, { ...thisRowInfo, height: tr.getBoundingClientRect().height }); + initialColumnMap.set(rowId, { ...thisRowInfo, height: tr?.getBoundingClientRect().height }); } for (let i = data.length - 1; i >= data.length - fixedBottomRows; i--) { const tr = trList[i] as HTMLElement; @@ -284,7 +284,7 @@ export default function useFixed( defaultBottom = tfoot?.getBoundingClientRect().height || 0; } thisRowInfo.bottom = (lastRowInfo.bottom || defaultBottom) + (lastRowInfo.height || 0); - initialColumnMap.set(rowId, { ...thisRowInfo, height: tr.getBoundingClientRect().height }); + initialColumnMap.set(rowId, { ...thisRowInfo, height: tr?.getBoundingClientRect().height }); } };