File tree 2 files changed +6
-8
lines changed
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 1
1
import * as React from 'react' ;
2
2
import { localeOption } from '../api/Api' ;
3
3
import { ColumnBase } from '../column/ColumnBase' ;
4
- import { useMergeProps , useUnmountEffect , useUpdateEffect } from '../hooks/Hooks' ;
4
+ import { useMergeProps , useUnmountEffect } from '../hooks/Hooks' ;
5
5
import { DomHandler , ObjectUtils } from '../utils/Utils' ;
6
6
import { BodyRow } from './BodyRow' ;
7
7
import { RowTogglerButton } from './RowTogglerButton' ;
@@ -167,7 +167,7 @@ export const TableBody = React.memo(
167
167
} ;
168
168
169
169
const allowRangeSelection = ( event ) => {
170
- return isMultipleSelection ( ) && event . originalEvent . shiftKey && anchorRowIndex . current !== null ;
170
+ return isMultipleSelection ( ) && event . originalEvent . shiftKey && anchorRowIndex . current !== null && ( anchorRowFirst . current === props . first || ( props . multiPageRangeSelection && ! props . lazy ) ) ;
171
171
} ;
172
172
173
173
const allowRowSelection = ( ) => {
@@ -882,12 +882,6 @@ export const TableBody = React.memo(
882
882
}
883
883
} ) ;
884
884
885
- useUpdateEffect ( ( ) => {
886
- if ( props . paginator && isMultipleSelection ( ) ) {
887
- anchorRowIndex . current = null ;
888
- }
889
- } , [ props . first ] ) ;
890
-
891
885
useUnmountEffect ( ( ) => {
892
886
if ( props . dragSelection ) {
893
887
unbindDragSelectionEvents ( ) ;
Original file line number Diff line number Diff line change @@ -1248,6 +1248,10 @@ interface DataTableBaseProps<TValue extends DataTableValueArray> extends Omit<Re
1248
1248
* An array of SortMeta objects to sort the data by default in multiple sort mode.
1249
1249
*/
1250
1250
multiSortMeta ?: DataTableSortMeta [ ] | null | undefined ;
1251
+ /**
1252
+ * Defines whether a range selection can cover multiple pages.
1253
+ */
1254
+ multiPageRangeSelection ?: boolean ;
1251
1255
/**
1252
1256
* Number of page links to display.
1253
1257
* @defaultValue 5
You can’t perform that action at this time.
0 commit comments