From 7de66e6ef3e851273e4a2a3dd32d3936596db534 Mon Sep 17 00:00:00 2001 From: guoming Date: Thu, 7 May 2026 21:18:29 +0800 Subject: [PATCH 1/3] fix: pass classNames.body.cell to VirtualCell in virtual mode In non-virtual mode, Body/index.tsx extracts classNames from TableContext and passes classNames.body to BodyRow, which then applies classNames.cell to each Cell. However, VirtualTable/BodyLine.tsx does not read classNames from TableContext, so VirtualCell never receives the body cell className. This causes custom cell classNames (e.g. from antd's Table wrapper like itp-design) to be missing on cells rendered in virtual scroll mode. --- src/VirtualTable/BodyLine.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/VirtualTable/BodyLine.tsx b/src/VirtualTable/BodyLine.tsx index d072c6954..c64001b64 100644 --- a/src/VirtualTable/BodyLine.tsx +++ b/src/VirtualTable/BodyLine.tsx @@ -25,9 +25,9 @@ const BodyLine = React.forwardRef((props, ref) => const { data, index, className, rowKey, style, extra, getHeight, ...restProps } = props; const { record, indent, index: renderIndex } = data; - const { scrollX, flattenColumns, prefixCls, fixColumn, componentWidth } = useContext( + const { scrollX, flattenColumns, prefixCls, fixColumn, componentWidth, classNames } = useContext( TableContext, - ['prefixCls', 'flattenColumns', 'fixColumn', 'componentWidth', 'scrollX'], + ['prefixCls', 'flattenColumns', 'fixColumn', 'componentWidth', 'scrollX', 'classNames'], ); const { getComponent } = useContext(StaticContext, ['getComponent']); @@ -103,6 +103,7 @@ const BodyLine = React.forwardRef((props, ref) => return ( Date: Fri, 8 May 2026 09:47:07 +0800 Subject: [PATCH 2/3] fix: pass styles.body.cell to VirtualCell for virtual table parity VirtualTable's BodyLine only forwarded classNames.body.cell but missed styles.body.cell, causing style customizations via the styles prop to be ignored in virtual mode while working in non-virtual mode. --- src/VirtualTable/BodyLine.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/VirtualTable/BodyLine.tsx b/src/VirtualTable/BodyLine.tsx index c64001b64..07caa7cc3 100644 --- a/src/VirtualTable/BodyLine.tsx +++ b/src/VirtualTable/BodyLine.tsx @@ -25,10 +25,16 @@ const BodyLine = React.forwardRef((props, ref) => const { data, index, className, rowKey, style, extra, getHeight, ...restProps } = props; const { record, indent, index: renderIndex } = data; - const { scrollX, flattenColumns, prefixCls, fixColumn, componentWidth, classNames } = useContext( - TableContext, - ['prefixCls', 'flattenColumns', 'fixColumn', 'componentWidth', 'scrollX', 'classNames'], - ); + const { scrollX, flattenColumns, prefixCls, fixColumn, componentWidth, classNames, styles } = + useContext(TableContext, [ + 'prefixCls', + 'flattenColumns', + 'fixColumn', + 'componentWidth', + 'scrollX', + 'classNames', + 'styles', + ]); const { getComponent } = useContext(StaticContext, ['getComponent']); const rowInfo = useRowInfo(record, rowKey, index, indent); @@ -104,6 +110,7 @@ const BodyLine = React.forwardRef((props, ref) => Date: Fri, 8 May 2026 09:59:08 +0800 Subject: [PATCH 3/3] fix: pass classNames.body.row and styles.body.row to RowComponent in virtual mode BodyLine's RowComponent was missing classNames.body.row and styles.body.row, causing row-level customizations to be ignored in virtual mode while working in non-virtual BodyRow. Co-Authored-By: Claude Opus 4.6 --- src/VirtualTable/BodyLine.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VirtualTable/BodyLine.tsx b/src/VirtualTable/BodyLine.tsx index 07caa7cc3..21562f69b 100644 --- a/src/VirtualTable/BodyLine.tsx +++ b/src/VirtualTable/BodyLine.tsx @@ -99,11 +99,11 @@ const BodyLine = React.forwardRef((props, ref) => {...restProps} data-row-key={rowKey} ref={rowSupportExpand ? null : ref} - className={clsx(className, `${prefixCls}-row`, rowProps?.className, { + className={clsx(className, `${prefixCls}-row`, rowProps?.className, classNames?.body?.row, { [expandedClsName]: indent >= 1, [`${prefixCls}-row-extra`]: extra, })} - style={{ ...rowStyle, ...rowProps?.style }} + style={{ ...rowStyle, ...rowProps?.style, ...styles?.body?.row }} > {flattenColumns.map((column, colIndex) => { return (