Skip to content

[2.x] Fix checkout navigation history with Turbo #921

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

Merged
merged 3 commits into from
Jul 10, 2025
Merged

Conversation

Jade-GG
Copy link
Collaborator

@Jade-GG Jade-GG commented Jul 10, 2025

Note: This issue only occurs in 2.x

When navigating to the checkout and then back to the homepage (by clicking the logo or similar), the back button will not send you back to the checkout anymore. This is because Turbo gets confused when you replace the current state without adding the restorationIdentifier.

I've used the current history.state variable for simplicity. If you wanted to be extremely specific about only adding the restorationIdentifier, you'd want to use this object:

{ turbo: { restorationIdentifier: Turbo.session.restorationIdentifier } }

@royduin royduin merged commit c11c1ce into 2.x Jul 10, 2025
15 checks passed
@royduin royduin deleted the Jade-GG-patch-2 branch July 10, 2025 14:54
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