Skip to content

Commit 6e1f25d

Browse files
fix: table generator column height
1 parent 09225ac commit 6e1f25d

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

packages/drip-table-generator/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drip-table-generator",
3-
"version": "3.2.2-alpha.2",
3+
"version": "3.2.2-alpha.3",
44
"description": "A visualization tool for generating schema of drip-table.",
55
"main": "dist/index.min.js",
66
"module": "lib/index.js",

packages/drip-table-generator/src/layouts/table-workstation/editable-table/components/left-columns/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ function LeftFixedColumnsInner<
6666
}, [props.tableConfig.hasSubTable, props.tableConfig.configs, props.columnList]);
6767
React.useImperativeHandle(ref, () => ({
6868
getRowHeight: () => {
69+
const rowHeight = rowRef.current?.offsetHeight ?? 0;
6970
let maxCellHeight = 0;
7071
for (const element of (rowRef.current?.children || []) as HTMLDivElement[]) {
7172
if (element.children[0]) {
@@ -75,7 +76,7 @@ function LeftFixedColumnsInner<
7576
}
7677
}
7778
}
78-
return maxCellHeight;
79+
return Math.max(rowHeight, maxCellHeight);
7980
},
8081
getSubTableHeight: () => {
8182
const rows = (containerRef.current?.children || []) as HTMLDivElement[];

packages/drip-table-generator/src/layouts/table-workstation/editable-table/components/right-columns/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ function RightFixedColumnsInner<
4545
const rowRef = React.createRef<HTMLDivElement>();
4646
React.useImperativeHandle(ref, () => ({
4747
getRowHeight: () => {
48+
const rowHeight = rowRef.current?.offsetHeight ?? 0;
4849
let maxCellHeight = 0;
4950
for (const element of (rowRef.current?.children || []) as HTMLDivElement[]) {
5051
if (element.children[0]) {
@@ -54,7 +55,7 @@ function RightFixedColumnsInner<
5455
}
5556
}
5657
}
57-
return maxCellHeight;
58+
return Math.max(rowHeight, maxCellHeight);
5859
},
5960
}));
6061
return (

packages/drip-table-generator/src/layouts/table-workstation/editable-table/components/scroll-columns/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ function ScrollableColumnsInner<
4747
const containerRef = React.createRef<HTMLDivElement>();
4848
React.useImperativeHandle(ref, () => ({
4949
getRowHeight: () => {
50+
const rowHeight = rowRef.current?.offsetHeight ?? 0;
5051
let maxCellHeight = 0;
5152
for (const element of (rowRef.current?.children || []) as HTMLDivElement[]) {
5253
if (element.children[0]) {
@@ -56,7 +57,7 @@ function ScrollableColumnsInner<
5657
}
5758
}
5859
}
59-
return maxCellHeight;
60+
return Math.max(rowHeight, maxCellHeight);
6061
},
6162
getRowHeaderHeights: () => {
6263
const rows = (containerRef.current?.children || []) as HTMLDivElement[];

0 commit comments

Comments
 (0)