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(InstantSearchNext): do not scroll on push #5861

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

aymeric-giraudet
Copy link
Member

@aymeric-giraudet aymeric-giraudet commented Sep 21, 2023

Summary

router.push scrolls to the top by default, so I made this PR to disable that as we don't do this is in other flavors.
We could make it into an option but I think it's best to leave it like that, it probably makes more sense to scroll to the top depending on the widget, for example Pagination, whereas it wouldn't make sense with InfiniteHits.

Also included a small fix to the README file

@aymeric-giraudet aymeric-giraudet requested review from a team, dhayab and sarahdayan and removed request for a team September 21, 2023 12:32
@codesandbox-ci
Copy link

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 f017038:

Sandbox Source
InstantSearch.js Configuration
react-instantsearch-app Configuration
example-react-instantsearch-default-theme Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-vue-instantsearch-default-theme Configuration

Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

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

good! scroll to top should be a separate feature from routing

@aymeric-giraudet aymeric-giraudet merged commit 771deea into master Sep 21, 2023
3 checks passed
@aymeric-giraudet aymeric-giraudet deleted the fix/instantsearch-next-routing-scroll branch September 21, 2023 14:33
@web-programmer-here
Copy link

@aymeric-giraudet @Haroenv how can I add back scrollTo? I am using pagination widget and on page change I am staying in the same spot without scrolling to the top.

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.

3 participants