mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-18 10:17:16 +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) {
|
if (!tableContainerRef.current) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
const resizeObserver = new ResizeObserver(() => setTableContainerHeightPx(tableContainerRef.current.offsetHeight));
|
||||||
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);
|
|
||||||
});
|
|
||||||
resizeObserver.observe(tableContainerRef.current);
|
resizeObserver.observe(tableContainerRef.current);
|
||||||
return () => resizeObserver.disconnect(); // clean up
|
return () => resizeObserver.disconnect(); // clean up
|
||||||
|
|
||||||
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return <FluentProvider theme={dataExplorerLightTheme} style={{ height: "100%" }}>
|
return <FluentProvider theme={dataExplorerLightTheme} style={{ height: "100%" }}>
|
||||||
|
@ -235,7 +235,7 @@ export const DocumentsTableComponent: React.FC<IDocumentsTableComponentProps> =
|
|||||||
</TableHeader>
|
</TableHeader>
|
||||||
<TableBody style={{ height: "100%", flex: 1 }}>
|
<TableBody style={{ height: "100%", flex: 1 }}>
|
||||||
<List
|
<List
|
||||||
height={height - 32}
|
height={height !== undefined ? height - 32 : 0}
|
||||||
itemCount={items.length}
|
itemCount={items.length}
|
||||||
itemSize={45}
|
itemSize={45}
|
||||||
width="100%"
|
width="100%"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user