修复表格滚动高度

This commit is contained in:
whyour
2022-10-25 23:12:38 +08:00
parent 68bb4f15e2
commit 48dd6ea826
4 changed files with 28 additions and 14 deletions
+5 -3
View File
@@ -254,6 +254,7 @@ const Env = () => {
const [searchText, setSearchText] = useState('');
const [tableScrollHeight, setTableScrollHeight] = useState<number>();
const [importLoading, setImportLoading] = useState(false);
const tableRef = useRef<any>();
const getEnvs = () => {
setLoading(true);
@@ -508,10 +509,10 @@ const Env = () => {
}, [searchText]);
useEffect(() => {
setTimeout(() => {
if (tableRef.current) {
setTableScrollHeight(getTableScroll({ extraHeight: 87 }));
});
}, []);
}
}, [tableRef.current]);
return (
<PageContainer
@@ -587,6 +588,7 @@ const Env = () => {
)}
<DndProvider backend={HTML5Backend}>
<Table
ref={tableRef}
columns={columns}
rowSelection={rowSelection}
pagination={false}