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(sortBy): do not write the default state #4798

Merged
merged 1 commit into from
Jun 29, 2021

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Jun 28, 2021

Summary

Without this check, if a route state is read (eg. in ssr) with the default value, it will be persisted in the URL, as the refinement is the default refinement, and the ui state was kept as-is, instead of being cleared.

Result

fixes algolia/vue-instantsearch#1005

Verified

This commit was signed with the committer’s verified signature.
edolstra Eelco Dolstra
Without this check, if a route state is read (eg. in ssr) with the default value, it will be persisted in the URL, as the refinement is the default refinement, and the ui state was kept as-is, instead of being cleared.

fixes algolia/vue-instantsearch#1005
@Haroenv Haroenv requested review from a team, tkrugg and francoischalifour and removed request for a team June 28, 2021 09:25
@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 6caebb6:

Sandbox Source
InstantSearch.js Configuration

@eunjae-lee
Copy link
Contributor

I think I understand the issue partially. How can I reproduce the issue on my own?

CleanShot.2021-06-28.at.15.49.32.mp4

I don't understand the flow of the default state added to state.

@Haroenv
Copy link
Contributor Author

Haroenv commented Jun 28, 2021

The default state gets added in Vue InstantSearch in server side rendering, not 100% sure how, but I can tell that it happens only then (see sandbox in linked issue) @eunjae-lee

@Haroenv Haroenv merged commit 1d8a40e into master Jun 29, 2021
@Haroenv Haroenv deleted the fix/sort-by-default-state branch June 29, 2021 08:05
Haroenv added a commit that referenced this pull request Jul 1, 2021
Without this check, if a route state is read (eg. in ssr) with the default value, it will be persisted in the URL, as the refinement is the default refinement, and the ui state was kept as-is, instead of being cleared.

fixes algolia/vue-instantsearch#1005
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.

SortBy applies query parameters to my url
3 participants