Compare commits

..
2 Commits
Author SHA1 Message Date
Tanner Linsley 62cff3d6bc 5.0.3 2017-02-09 10:07:37 -07:00
Tanner Linsley 057a815337 Adjust current page if available pages dips below current page
Fixes #69
2017-02-09 10:07:33 -07:00
2 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "react-table",
"version": "5.0.2",
"version": "5.0.3",
"description": "A fast, lightweight, opinionated table and datagrid built on React",
"license": "MIT",
"homepage": "https://github.com/tannerlinsley/react-table#readme",
+7 -2
View File
@@ -10,7 +10,9 @@ export default {
pivotValKey,
subRowsKey,
expanderColumnWidth,
SubComponent
SubComponent,
page,
pageSize
} = this.getResolvedState(nextProps, nextState)
// Determine Header Groups
@@ -212,13 +214,16 @@ export default {
resolvedData = groupRecursively(resolvedData, pivotBy)
}
const newPages = Math.ceil(resolvedData.length / pageSize)
return {
resolvedData,
pivotColumn,
allVisibleColumns,
headerGroups,
allDecoratedColumns,
hasHeaderGroups
hasHeaderGroups,
page: (page + 1) > newPages ? newPages - 1 : page
}
},
getSortedData (nextProps, nextState) {