From 11266dc82b3c42f1a5de6badfc4789d38b4c29a6 Mon Sep 17 00:00:00 2001 From: kodtLin <973672492@qq.com> Date: Fri, 19 Sep 2025 01:06:24 +0800 Subject: [PATCH 1/3] fix(MeasureRow): clone the column without ref so that ref can point to the real columnHeader. --- src/Body/MeasureRow.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Body/MeasureRow.tsx b/src/Body/MeasureRow.tsx index 3b9b864b6..e5a3d8961 100644 --- a/src/Body/MeasureRow.tsx +++ b/src/Body/MeasureRow.tsx @@ -36,12 +36,16 @@ const MeasureRow: React.FC = ({ > {columnsKey.map(columnKey => { const column = columns.find(col => col.key === columnKey); + const rawTitle = column?.title; + const titleForMeasure = React.isValidElement(rawTitle) + ? React.cloneElement(rawTitle, { ref: null }) + : rawTitle; return ( ); })} From 7c534bcc89003cade17840f0d36c6b246c6764f9 Mon Sep 17 00:00:00 2001 From: kodtLin <973672492@qq.com> Date: Sat, 20 Sep 2025 02:46:26 +0800 Subject: [PATCH 2/3] fix(Body/MeasureRow): fix the type error when clone ReactElement --- src/Body/MeasureRow.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Body/MeasureRow.tsx b/src/Body/MeasureRow.tsx index e5a3d8961..269562226 100644 --- a/src/Body/MeasureRow.tsx +++ b/src/Body/MeasureRow.tsx @@ -38,7 +38,10 @@ const MeasureRow: React.FC = ({ const column = columns.find(col => col.key === columnKey); const rawTitle = column?.title; const titleForMeasure = React.isValidElement(rawTitle) - ? React.cloneElement(rawTitle, { ref: null }) + ? React.cloneElement( + rawTitle as React.ReactElement>, + { ref: null }, + ) : rawTitle; return ( Date: Mon, 22 Sep 2025 01:52:22 +0800 Subject: [PATCH 3/3] Refactor titleForMeasure assignment logic --- src/Body/MeasureRow.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Body/MeasureRow.tsx b/src/Body/MeasureRow.tsx index 269562226..1211839c6 100644 --- a/src/Body/MeasureRow.tsx +++ b/src/Body/MeasureRow.tsx @@ -37,11 +37,8 @@ const MeasureRow: React.FC = ({ {columnsKey.map(columnKey => { const column = columns.find(col => col.key === columnKey); const rawTitle = column?.title; - const titleForMeasure = React.isValidElement(rawTitle) - ? React.cloneElement( - rawTitle as React.ReactElement>, - { ref: null }, - ) + const titleForMeasure = React.isValidElement>(rawTitle) + ? React.cloneElement(rawTitle, { ref: null }) : rawTitle; return (