diff --git a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx index 09badf11a..80117b852 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(() => tableContainerRef.current.offsetHeight !== undefined && setTableContainerHeightPx(tableContainerRef.current.offsetHeight)); resizeObserver.observe(tableContainerRef.current); return () => resizeObserver.disconnect(); // clean up - - }, []); return @@ -571,9 +564,9 @@ const DocumentsTabComponent: React.FunctionComponent<{ {/* doesn't like to be a flex child */}
-
- +
{JSON.stringify(currentDocument, undefined, " ")}
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 =