From cccb7f5c731b338465be0f97815715424a724c1e Mon Sep 17 00:00:00 2001 From: Laurent Nguyen Date: Thu, 29 Feb 2024 13:51:03 +0100 Subject: [PATCH] Fix NaN height issue --- src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx | 9 +-------- .../Tabs/DocumentsTabV2/DocumentsTableComponent.tsx | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx index 09badf11a..db2b8d36b 100644 --- a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx +++ b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx @@ -448,16 +448,9 @@ const DocumentsTabComponent: React.FunctionComponent<{ if (!tableContainerRef.current) { return undefined; } - - const resizeObserver = new ResizeObserver(() => { - // Do what you want to do when the size of the element changes - setTableContainerHeightPx(tableContainerRef.current.offsetHeight); - console.log('height', tableContainerRef.current.offsetHeight); - }); + const resizeObserver = new ResizeObserver(() => setTableContainerHeightPx(tableContainerRef.current.offsetHeight)); resizeObserver.observe(tableContainerRef.current); return () => resizeObserver.disconnect(); // clean up - - }, []); return diff --git a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx index 53e783aa3..428c3162f 100644 --- a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx +++ b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx @@ -235,7 +235,7 @@ export const DocumentsTableComponent: React.FC =