File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import * as React from 'react' ;
22import { localeOption } from '../api/Api' ;
33import { ColumnBase } from '../column/ColumnBase' ;
4- import { useMergeProps , useUnmountEffect , useUpdateEffect } from '../hooks/Hooks' ;
4+ import { useMergeProps , useUnmountEffect } from '../hooks/Hooks' ;
55import { DomHandler , ObjectUtils } from '../utils/Utils' ;
66import { BodyRow } from './BodyRow' ;
77import { RowTogglerButton } from './RowTogglerButton' ;
@@ -167,7 +167,7 @@ export const TableBody = React.memo(
167167 } ;
168168
169169 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 ) ) ;
171171 } ;
172172
173173 const allowRowSelection = ( ) => {
@@ -882,12 +882,6 @@ export const TableBody = React.memo(
882882 }
883883 } ) ;
884884
885- useUpdateEffect ( ( ) => {
886- if ( props . paginator && isMultipleSelection ( ) ) {
887- anchorRowIndex . current = null ;
888- }
889- } , [ props . first ] ) ;
890-
891885 useUnmountEffect ( ( ) => {
892886 if ( props . dragSelection ) {
893887 unbindDragSelectionEvents ( ) ;
Original file line number Diff line number Diff line change @@ -1248,6 +1248,10 @@ interface DataTableBaseProps<TValue extends DataTableValueArray> extends Omit<Re
12481248 * An array of SortMeta objects to sort the data by default in multiple sort mode.
12491249 */
12501250 multiSortMeta ?: DataTableSortMeta [ ] | null | undefined ;
1251+ /**
1252+ * Defines whether a range selection can cover multiple pages.
1253+ */
1254+ multiPageRangeSelection ?: boolean ;
12511255 /**
12521256 * Number of page links to display.
12531257 * @defaultValue 5
You can’t perform that action at this time.
0 commit comments