Skip to content

Commit

Permalink
Merge pull request #56 from jbetancur/bug-disable-pagination-on-zero-…
Browse files Browse the repository at this point in the history
…rows

pagination should not show when zero rows
  • Loading branch information
jbetancur authored Jan 9, 2019
2 parents 134b688 + 3fe61d0 commit 951f271
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DataTable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ class DataTable extends Component {
} = this.state;

const theme = merge(defaultTheme, customTheme);
const enabledPagination = pagination && !progressPending && rows.length > 0;
const init = {
...this.props,
...this.state,
Expand Down Expand Up @@ -315,7 +316,7 @@ class DataTable extends Component {
</Table>
)}

{pagination && !progressPending && (
{enabledPagination && (
<TableFooter>
<Pagination
onChangePage={this.handleChangePage}
Expand Down

0 comments on commit 951f271

Please sign in to comment.