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

Commit

Permalink
fix #971
Browse files Browse the repository at this point in the history
  • Loading branch information
godev7 committed Jul 5, 2017
1 parent 6a82e3c commit ac4089e
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 ac4089e

Please sign in to comment.