Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Merge pull request #986 from robertup/dev-971
Browse files Browse the repository at this point in the history
#971 Page Up and Page Down load all data even if there is only one page
  • Loading branch information
metas-ts committed Jul 6, 2017
2 parents 6a82e3c + ac4089e commit af0b17f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/shortcuts/PaginationContextShortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class PaginationContextShortcuts extends Component {

handleShortcuts = (action, event) => {
const {
handleFirstPage, handleLastPage, handlePrevPage, handleNextPage
handleFirstPage, handleLastPage, handlePrevPage, handleNextPage, pages
} = this.props;

switch (action) {
Expand All @@ -20,10 +20,14 @@ class PaginationContextShortcuts extends Component {
return handleLastPage();
case 'NEXT_PAGE':
event.preventDefault();
return handleNextPage();
if (pages > 1)
return handleNextPage();
return;
case 'PREV_PAGE':
event.preventDefault();
return handlePrevPage();
if (pages > 1)
return handlePrevPage();
return;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/components/table/TablePagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ class TablePagination extends Component {
}
handleNextPage={() => handleChangePage('up')}
handlePrevPage={() => handleChangePage('down')}
pages={pages}
/>
}
</div>
Expand Down

0 comments on commit af0b17f

Please sign in to comment.