algolia / instantsearch

⚡️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/
MIT License
3.68k stars 514 forks source link

fix(pagination): any page outside the range is also first or last #6252

Closed Haroenv closed 3 months ago

Haroenv commented 3 months ago

Summary

If the page is outside the range, it should behave like the 0th or last page. This disables the relevant buttons and links, which makes more sense UX-wise, and avoids creating pages that don't exist when you start from an invalid URL.

CR-6249

Result

codesandbox-ci[bot] commented 3 months ago

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 796c2837f2a75a98561e86e504937fe63b62e282:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration