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

Preserve existing URL parameters in history. #2777

Merged
merged 1 commit into from
May 19, 2022
Merged

Preserve existing URL parameters in history. #2777

merged 1 commit into from
May 19, 2022

Conversation

JakePT
Copy link
Contributor

@JakePT JakePT commented May 19, 2022

Description of the Change

Fixes an issue where any existing non-ElasticPress URL parameters would be cleared when using Instant Results, and an additional side effect where parameters would be removed when page was refreshed while Instant Results was activated, even if it wasn't actively being used at the time.

Previously when Instant Results updated the browser history state it would replace all URL parameters with Instant Results parameters, and when Instant Results was closed all of those parameters would be cleared, leaving none.

This PR changes it so that any URLs present in the URL when a page is loaded are preserved throughout the course of using Instant Results, which also fixes the refresh issue.

Closes #2775.

Verification Process

Navigating backwards and forwards through the Instant Results history should work as before, but the issue described in #2775 should not occur.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Fixed - A bug where URL search parameters could be cleared when using Instant Results.

Credits

Props @JakePT

@JakePT JakePT requested a review from felipeelia May 19, 2022 14:15
@felipeelia felipeelia added this to the 4.2.0 milestone May 19, 2022
@felipeelia felipeelia self-assigned this May 19, 2022
@felipeelia felipeelia merged commit 61b3e25 into develop May 19, 2022
@felipeelia felipeelia deleted the fix/2775 branch May 19, 2022 15:28
felipeelia added a commit that referenced this pull request May 19, 2022
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.

BUG: With Instant Results URL parameters are not persist on page refresh
2 participants