Skip to content

Commit

Permalink
Merge pull request #2208 from TheDocTrier/empty-pagination
Browse files Browse the repository at this point in the history
Support rendering empty data in pagination
  • Loading branch information
zachleat authored May 11, 2022
2 parents eed47c3 + 3ada104 commit 7da411d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Plugins/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,13 @@ class Pagination {
throw new Error("Missing `setData` call for Pagination object.");
}

return lodashChunk(this.target, this.size);
const chunks = lodashChunk(this.target, this.size);

if (this.data.pagination && this.data.pagination.renderEmpty) {
return chunks.length ? chunks : [[]];
} else {
return chunks;
}
}

// TODO this name is not good
Expand Down

0 comments on commit 7da411d

Please sign in to comment.