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 = [
160
160
} ,
161
161
] ;
162
162
163
- function cleanOnCell ( cols : any = [ ] ) {
163
+ export function cleanOnCell ( cols : any = [ ] ) {
164
164
cols . forEach ( col => {
165
165
delete ( col as any ) . onCell ;
166
166
167
167
cleanOnCell ( ( col as any ) . children ) ;
168
168
} ) ;
169
169
}
170
- cleanOnCell ( columns ) ;
170
+ // cleanOnCell(columns);
171
171
172
172
const data : RecordType [ ] = new Array ( 4 * 10000 ) . fill ( null ) . map ( ( _ , index ) => ( {
173
173
a : `a${ index } ` ,
@@ -201,11 +201,11 @@ const Demo = () => {
201
201
scroll = { { x : 1200 , y : scrollY ? 200 : null } }
202
202
data = { data }
203
203
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
+ // }}
209
209
// onRow={() => ({ className: 'rowed' })}
210
210
rowClassName = "nice-try"
211
211
/>
Original file line number Diff line number Diff line change 1
1
import * as React from 'react' ;
2
- import { getCellProps , type useRowInfo } from '../Body/BodyRow' ;
2
+ import { getCellProps } from '../Body/BodyRow' ;
3
3
import Cell from '../Cell' ;
4
4
import type { ColumnType } from '../interface' ;
5
5
import classNames from 'classnames' ;
6
6
import { useContext } from '@rc-component/context' ;
7
7
import { GridContext } from './context' ;
8
+ import type useRowInfo from '../hooks/useRowInfo' ;
8
9
9
10
export interface VirtualCellProps < RecordType extends { index : number } > {
10
11
rowInfo : ReturnType < typeof useRowInfo > ;
@@ -88,6 +89,14 @@ function VirtualCell<RecordType extends { index: number } = any>(
88
89
const mergedRender = needHide ? ( ) => null : render ;
89
90
90
91
// ========================== 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
+
91
100
return (
92
101
< Cell
93
102
className = { classNames ( columnClassName , className ) }
@@ -108,10 +117,7 @@ function VirtualCell<RecordType extends { index: number } = any>(
108
117
additionalProps = { {
109
118
...additionalCellProps ,
110
119
style : mergedStyle ,
111
-
112
- // Virtual should reset `colSpan` & `rowSpan`
113
- rowSpan : 1 ,
114
- colSpan : 1 ,
120
+ ...cellSpan ,
115
121
} }
116
122
/>
117
123
) ;
You can’t perform that action at this time.
0 commit comments