File tree Expand file tree Collapse file tree 2 files changed +18
-12
lines changed
Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -160,14 +160,14 @@ const columns: ColumnsType = [
160160 } ,
161161] ;
162162
163- function cleanOnCell ( cols : any = [ ] ) {
163+ export function cleanOnCell ( cols : any = [ ] ) {
164164 cols . forEach ( col => {
165165 delete ( col as any ) . onCell ;
166166
167167 cleanOnCell ( ( col as any ) . children ) ;
168168 } ) ;
169169}
170- cleanOnCell ( columns ) ;
170+ // cleanOnCell(columns);
171171
172172const data : RecordType [ ] = new Array ( 4 * 10000 ) . fill ( null ) . map ( ( _ , index ) => ( {
173173 a : `a${ index } ` ,
@@ -201,11 +201,11 @@ const Demo = () => {
201201 scroll = { { x : 1200 , y : scrollY ? 200 : null } }
202202 data = { data }
203203 rowKey = "indexKey"
204- expandable = { {
205- expandedRowRender : ( ) => 2333 ,
206- columnWidth : 60 ,
207- expandedRowClassName : ( ) => 'good-one' ,
208- } }
204+ // expandable={{
205+ // expandedRowRender: () => 2333,
206+ // columnWidth: 60,
207+ // expandedRowClassName: () => 'good-one',
208+ // }}
209209 // onRow={() => ({ className: 'rowed' })}
210210 rowClassName = "nice-try"
211211 />
Original file line number Diff line number Diff line change 11import * as React from 'react' ;
2- import { getCellProps , type useRowInfo } from '../Body/BodyRow' ;
2+ import { getCellProps } from '../Body/BodyRow' ;
33import Cell from '../Cell' ;
44import type { ColumnType } from '../interface' ;
55import classNames from 'classnames' ;
66import { useContext } from '@rc-component/context' ;
77import { GridContext } from './context' ;
8+ import type useRowInfo from '../hooks/useRowInfo' ;
89
910export interface VirtualCellProps < RecordType extends { index : number } > {
1011 rowInfo : ReturnType < typeof useRowInfo > ;
@@ -88,6 +89,14 @@ function VirtualCell<RecordType extends { index: number } = any>(
8889 const mergedRender = needHide ? ( ) => null : render ;
8990
9091 // ========================== Render ==========================
92+ const cellSpan : React . TdHTMLAttributes < HTMLElement > = { } ;
93+
94+ // Virtual should reset `colSpan` & `rowSpan`
95+ if ( rowSpan === 0 || colSpan === 0 ) {
96+ cellSpan . rowSpan = 1 ;
97+ cellSpan . colSpan = 1 ;
98+ }
99+
91100 return (
92101 < Cell
93102 className = { classNames ( columnClassName , className ) }
@@ -108,10 +117,7 @@ function VirtualCell<RecordType extends { index: number } = any>(
108117 additionalProps = { {
109118 ...additionalCellProps ,
110119 style : mergedStyle ,
111-
112- // Virtual should reset `colSpan` & `rowSpan`
113- rowSpan : 1 ,
114- colSpan : 1 ,
120+ ...cellSpan ,
115121 } }
116122 />
117123 ) ;
You can’t perform that action at this time.
0 commit comments