Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Commit

Permalink
bugfix pageSize
Browse files Browse the repository at this point in the history
  • Loading branch information
sajrashid committed Jul 27, 2021
1 parent 59c824e commit 778cadd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/react-dj-table/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-dj-table",
"version": "1.1.15",
"version": "1.1.16",
"description": "React Dynamic Resposive Json HTML Table",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/components/react-dj-table/reducers/tableReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export const TableReducer = (state, action) => {
return { ...state }
case ACTIONS.ITEMSPERPAGE:
resetRows()
state.totalPages = Math.ceil(state.jsonCopy.length / action.payload.itemsPerPage)
state.pageSize = action.payload.itemsPerPage
state.totalPages = Math.ceil(state.jsonCopy.length / state.pageSize)
state.pageNo = 1
if (action.payload.itemsPerPage) {
state.json = paginate(state.jsonCopy || [], state.pageSize, 0)
Expand Down

0 comments on commit 778cadd

Please sign in to comment.