mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-29 17:06:58 +00:00
Fix NaN height issue
This commit is contained in:
parent
82c7760af2
commit
cccb7f5c73
@ -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 <FluentProvider theme={dataExplorerLightTheme} style={{ height: "100%" }}>
|
||||
|
@ -235,7 +235,7 @@ export const DocumentsTableComponent: React.FC<IDocumentsTableComponentProps> =
|
||||
</TableHeader>
|
||||
<TableBody style={{ height: "100%", flex: 1 }}>
|
||||
<List
|
||||
height={height - 32}
|
||||
height={height !== undefined ? height - 32 : 0}
|
||||
itemCount={items.length}
|
||||
itemSize={45}
|
||||
width="100%"
|
||||
|
Loading…
Reference in New Issue
Block a user