@@ -199,10 +199,6 @@ export const TableBody = React.memo(
199
199
return options ? options [ option ] : null ;
200
200
} ;
201
201
202
- const getProcessedDataIndex = ( rowIndex ) => {
203
- return props . lazy ? rowIndex - props . first : rowIndex ;
204
- } ;
205
-
206
202
const findIndex = ( collection , rowData ) => {
207
203
return ( collection || [ ] ) . findIndex ( ( data ) => equals ( rowData , data ) ) ;
208
204
} ;
@@ -355,17 +351,15 @@ export const TableBody = React.memo(
355
351
let rangeEnd ;
356
352
357
353
const isAllowCellSelection = allowCellSelection ( ) ;
358
- const rangeRowIndexInProcessedData = getProcessedDataIndex ( rangeRowIndex . current ) ;
359
- const anchorRowIndexInProcessedData = getProcessedDataIndex ( anchorRowIndex . current ) ;
360
-
361
- if ( rangeRowIndexInProcessedData > anchorRowIndexInProcessedData ) {
362
- rangeStart = anchorRowIndexInProcessedData ;
363
- rangeEnd = rangeRowIndexInProcessedData ;
364
- } else if ( rangeRowIndexInProcessedData < anchorRowIndexInProcessedData ) {
365
- rangeStart = rangeRowIndexInProcessedData ;
366
- rangeEnd = anchorRowIndexInProcessedData ;
354
+
355
+ if ( rangeRowIndex . current > anchorRowIndex . current ) {
356
+ rangeStart = anchorRowIndex . current ;
357
+ rangeEnd = rangeRowIndex . current ;
358
+ } else if ( rangeRowIndex . current < anchorRowIndex . current ) {
359
+ rangeStart = rangeRowIndex . current ;
360
+ rangeEnd = anchorRowIndex . current ;
367
361
} else {
368
- rangeStart = rangeEnd = rangeRowIndexInProcessedData ;
362
+ rangeStart = rangeEnd = rangeRowIndex . current ;
369
363
}
370
364
371
365
return isAllowCellSelection ? selectRangeOnCell ( event , rangeStart , rangeEnd ) : selectRangeOnRow ( event , rangeStart , rangeEnd ) ;
@@ -410,7 +404,7 @@ export const TableBody = React.memo(
410
404
for ( let i = rowRangeStart ; i <= rowRangeEnd ; i ++ ) {
411
405
let rowData = value [ i ] ;
412
406
let columns = props . columns ;
413
- let rowIndex = props . lazy ? i + props . first : i ;
407
+ let rowIndex = props . paginator ? i + props . first : i ;
414
408
415
409
for ( let j = cellRangeStart ; j <= cellRangeEnd ; j ++ ) {
416
410
let field = getColumnProp ( columns [ j ] , 'field' ) ;
@@ -941,7 +935,7 @@ export const TableBody = React.memo(
941
935
} ;
942
936
943
937
const createGroupHeader = ( rowData , rowIndex , expanded , colSpan ) => {
944
- if ( isSubheaderGrouping && shouldRenderRowGroupHeader ( props . value , rowData , getProcessedDataIndex ( rowIndex ) ) ) {
938
+ if ( isSubheaderGrouping && shouldRenderRowGroupHeader ( props . value , rowData , rowIndex - props . first ) ) {
945
939
const style = rowGroupHeaderStyle ( ) ;
946
940
const toggler = props . expandableRowGroups && (
947
941
< RowTogglerButton
0 commit comments