Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pagination): isLastPage when there's no pages #4422

Merged
merged 3 commits into from
Jun 3, 2020

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Jun 3, 2020

fixes algolia/vue-instantsearch#785

Summary

This is discovered by @dotboris. When there are no pages, this.total === 0, so this.currentPage - 1 will be -1 instead of 0, and falsely indicate it's not the last page.

Result

isLastPage is true when there's no results.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 3, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 19873e4:

Sandbox Source
InstantSearch.js Configuration

Copy link
Contributor

@eunjae-lee eunjae-lee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
Thanks again to @dotboris !

@Haroenv Haroenv merged commit 92bcc02 into master Jun 3, 2020
@francoischalifour francoischalifour deleted the fix/pagination-empty branch June 8, 2020 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pagination allows clicking on next & last buttons when there are no results
3 participants