Skip to content

Commit

Permalink
Fixed #1691 - DataView throws an exception when the last page is reac…
Browse files Browse the repository at this point in the history
…hed using Paginator
  • Loading branch information
mertsincan committed Nov 26, 2020
1 parent c147001 commit afae4f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/dataview/DataView.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ export class DataView extends Component {
if (this.props.paginator) {
const rows = this.props.onPage ? this.props.rows : this.state.rows;
const first = this.props.lazy ? 0 : this.props.onPage ? this.props.first : this.state.first;
const last = rows + first;
const totalRecords = this.getTotalRecords();
const last = Math.min(rows + first, totalRecords);
let items = [];

for (let i = first; i < last; i++) {
Expand Down

0 comments on commit afae4f1

Please sign in to comment.