Skip to content

Commit ac6dc1c

Browse files
fix: table height changed with scrolly changed
1 parent 11a28c5 commit ac6dc1c

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

packages/drip-table-generator/src/layouts/table-workstation/components/table-container/index.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
.@{prefixCls}-wrapper {
1414
border: 1px solid transparent;
15-
padding: 0 12px 8px;
15+
padding: 0 12px;
1616
width: max-content;
1717
position: relative;
1818
min-width: 500px;

packages/drip-table-generator/src/layouts/table-workstation/components/table-container/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ const TableContainer = React.forwardRef(<
136136
checked: currentTableID === props.tableConfig.tableId,
137137
bordered: tableIndex > 0,
138138
})}
139-
style={{ marginTop: currentTableID === props.tableConfig.tableId && tableIndex === 0 ? 32 : void 0 }}
139+
style={{
140+
marginTop: currentTableID === props.tableConfig.tableId && tableIndex === 0 ? 32 : void 0,
141+
}}
140142
ref={containerRef}
141143
onClick={(e) => {
142144
e.stopPropagation();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function ScrollableColumnsInner<
5050
let maxCellHeight = 0;
5151
for (const element of (rowRef.current?.children || []) as HTMLDivElement[]) {
5252
if (element.children[0]) {
53-
const trueCellHeight = (element.children[0] as HTMLDivElement).offsetHeight;
53+
const trueCellHeight = (element.children[0] as HTMLDivElement).offsetHeight + 28;
5454
if (trueCellHeight > maxCellHeight) {
5555
maxCellHeight = trueCellHeight;
5656
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function EditableTable<
7474
return props.tableConfig.configs.scroll?.y;
7575
}
7676
return '100%';
77-
}, []);
77+
}, [props.tableConfig.configs.scroll?.y]);
7878
const tableWidth = React.useMemo(() => {
7979
const defaultWidth = props.tableConfig.columns.length * 200;
8080
return containerRef.current?.getContainerWidth?.() || defaultWidth;

0 commit comments

Comments
 (0)