react-paginate
react-paginate copied to clipboard
marginPagesDisplayed when set to 0 shows break at the end
Hello,
Thanks for providing this library, I appreciate the effort. Not sure if this is really an issue, but I thought I'd raise an ticket nonetheless.
When setting marginPagesDisplayed
to 0, I excepted the pagination to render like this:
<ReactPaginate
pageRangeDisplayed={4}
marginPagesDisplayed={0}
onPageChange={handlePageClick}
pageCount={pageCount}
forcePage={page}
/>
Instead, there is a break at the end:
The issue seems to be coming from this line: https://github.com/AdeleD/react-paginate/blob/98db5f7a456919caa0e050164800766f7ca7f2c4/react_components/PaginationBoxView.js#L470-L471
I reckon these two checks need to be separated:
// We do not show break if only one active page is displayed.
pageRangeDisplayed > 0 &&
marginPagesDisplayed > 0
Let me know if you'd like me to submit a PR!