Skip to content

Commit 00f42d7

Browse files
author
路振凯
committed
fix: resolve bot review
1 parent bc3e1f5 commit 00f42d7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Body/BodyRow.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export function getCellProps<RecordType>(
4646
rowKeys: React.Key[] = [],
4747
expandedRowOffset = 0,
4848
rowStickyOffsets?: ReturnType<typeof useStickyOffsets>,
49+
hasColSpanZero?: boolean,
4950
) {
5051
const {
5152
record,
@@ -67,7 +68,7 @@ export function getCellProps<RecordType>(
6768
const key = columnsKey[colIndex];
6869
let fixedInfo = fixedInfoList[colIndex];
6970

70-
if (column.fixed && rowStickyOffsets) {
71+
if (column.fixed && hasColSpanZero) {
7172
fixedInfo = getCellFixedInfo(colIndex, colIndex, flattenColumns, rowStickyOffsets);
7273
}
7374
let appendCellNode: React.ReactNode;
@@ -217,6 +218,7 @@ function BodyRow<RecordType extends { children?: readonly RecordType[] }>(
217218
rowKeys,
218219
expandedRowInfo?.offset,
219220
rowStickyOffsets,
221+
hasColSpanZero,
220222
);
221223

222224
return (

src/hooks/useStickyOffsets.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ function useStickyOffsets<RecordType>(
2828
if (rowContext) {
2929
const cellProps = column.onCell?.(rowContext.record, rowContext.rowIndex) || {};
3030
colSpan = cellProps.colSpan ?? 1;
31-
} else {
32-
colSpan = column.colSpan ?? 1;
3331
}
3432

3533
if (column.fixed && colSpan !== 0) {
@@ -49,7 +47,7 @@ function useStickyOffsets<RecordType>(
4947
widths: colWidths,
5048
isSticky: flattenColumns.some(column => column.fixed),
5149
};
52-
}, [colWidths, flattenColumns, ...(rowContext ? [rowContext.record, rowContext.rowIndex] : [])]);
50+
}, [colWidths, flattenColumns, rowContext]);
5351

5452
return stickyOffsets;
5553
}

0 commit comments

Comments
 (0)