Skip to content

Commit 11266dc

Browse files
committed
fix(MeasureRow): clone the column without ref so that ref can point to the real columnHeader.
1 parent ee7bfc1 commit 11266dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Body/MeasureRow.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@ const MeasureRow: React.FC<MeasureRowProps> = ({
3636
>
3737
{columnsKey.map(columnKey => {
3838
const column = columns.find(col => col.key === columnKey);
39+
const rawTitle = column?.title;
40+
const titleForMeasure = React.isValidElement(rawTitle)
41+
? React.cloneElement(rawTitle, { ref: null })
42+
: rawTitle;
3943
return (
4044
<MeasureCell
4145
key={columnKey}
4246
columnKey={columnKey}
4347
onColumnResize={onColumnResize}
44-
title={column?.title}
48+
title={titleForMeasure}
4549
/>
4650
);
4751
})}

0 commit comments

Comments
 (0)