mirror of
https://github.com/gosticks/react-table.git
synced 2026-08-11 20:40:17 +00:00
fix(usepagination resetpage on globalfilter change): pageIndex reset (#1813)
autoReset pageIndex on globalFilter change "fix #1812"
This commit is contained in:
committed by
Tanner Linsley
parent
8e310bd0e6
commit
2a0dc6778d
+7
-7
@@ -19,21 +19,21 @@
|
||||
}
|
||||
},
|
||||
"dist\\index.js": {
|
||||
"bundled": 104977,
|
||||
"minified": 48560,
|
||||
"gzipped": 13057
|
||||
"bundled": 113237,
|
||||
"minified": 52528,
|
||||
"gzipped": 13837
|
||||
},
|
||||
"dist\\index.es.js": {
|
||||
"bundled": 104090,
|
||||
"minified": 47770,
|
||||
"gzipped": 12900,
|
||||
"bundled": 112300,
|
||||
"minified": 51692,
|
||||
"gzipped": 13671,
|
||||
"treeshaked": {
|
||||
"rollup": {
|
||||
"code": 80,
|
||||
"import_statements": 21
|
||||
},
|
||||
"webpack": {
|
||||
"code": 8227
|
||||
"code": 8461
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ The following options are supported via the main options object passed to `useTa
|
||||
- When `true`, the `pageIndex` state will automatically reset if `manualPagination` is `false` and any of the following conditions are met:
|
||||
- `data` is changed
|
||||
- `manualSortBy` is `false` and `state.sortBy` is changed
|
||||
- `manualGlobalFilter` is `false` and `state.globalFilter` is changed
|
||||
- `manualFilters` is `false` and `state.filters` is changed
|
||||
- `manualGroupBy` is `false` and `state.groupBy` is changed
|
||||
- To disable, set to `false`
|
||||
|
||||
@@ -76,10 +76,11 @@ function useInstance(instance) {
|
||||
pageCount: userPageCount,
|
||||
paginateExpandedRows = true,
|
||||
expandSubRows = true,
|
||||
state: { pageSize, pageIndex, expanded, filters, groupBy, sortBy },
|
||||
state: { pageSize, pageIndex, expanded, globalFilter, filters, groupBy, sortBy },
|
||||
dispatch,
|
||||
data,
|
||||
manualPagination,
|
||||
manualGlobalFilter,
|
||||
manualFilters,
|
||||
manualGroupBy,
|
||||
manualSortBy,
|
||||
@@ -87,7 +88,7 @@ function useInstance(instance) {
|
||||
|
||||
ensurePluginOrder(
|
||||
plugins,
|
||||
['useFilters', 'useGroupBy', 'useSortBy', 'useExpanded'],
|
||||
['useGlobalFilter', 'useFilters', 'useGroupBy', 'useSortBy', 'useExpanded'],
|
||||
'usePagination',
|
||||
[]
|
||||
)
|
||||
@@ -101,6 +102,7 @@ function useInstance(instance) {
|
||||
}, [
|
||||
dispatch,
|
||||
manualPagination ? null : data,
|
||||
manualPagination || manualGlobalFilter ? null : globalFilter,
|
||||
manualPagination || manualFilters ? null : filters,
|
||||
manualPagination || manualGroupBy ? null : groupBy,
|
||||
manualPagination || manualSortBy ? null : sortBy,
|
||||
|
||||
Reference in New Issue
Block a user