fix: table height shrinking with large data set at full height (#4787)

This commit is contained in:
Katherine 2024-07-02 13:58:15 +08:00 committed by GitHub
parent 73d510511d
commit 6609870aed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -165,7 +165,6 @@ export const useBlockHeight = () => {
return height;
};
export const useTableSize = () => {
const [height, setTableHeight] = useState<number>();
const [width, setTableWidth] = useState<number>();
const elementRef = useRef<HTMLDivElement>(null);
const targetHeight = useTableHeight();
@ -176,7 +175,6 @@ export const useTableSize = () => {
const tableContentRect = elementRef.current.querySelector('.ant-table')?.getBoundingClientRect();
if (!tableContentRect) return;
setTableWidth(clientRect.width);
setTableHeight(targetHeight);
}, 100),
[targetHeight],
);
@ -190,8 +188,7 @@ export const useTableSize = () => {
);
useEventListener('resize', calcTableSize);
return { height, width, tableSizeRefCallback };
return { height: targetHeight, width, tableSizeRefCallback };
};
const hasActionContainerInParentChain = (schema) => {