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

[1.x] Fix history navigation issue #1992

Merged
merged 3 commits into from
Oct 1, 2024
Merged

Conversation

pedroborges
Copy link
Collaborator

I noticed an issue introduced by #1984 when using the Vue 2/3 and Svelte adapters. On the playgrounds for these adapters, navigating through HomeUsersArticleForm and then trying to go back in history skips the Article page.

Root cause:

After investigating, I found that router.replaceState (which remembers the form state) was being called before router.pushState, effectively replacing the Article history state.

before-fix

Solution:

I tried several approaches but determined that the safest solution is to scope the fix from #1984 specifically to Chrome on iOS, where the initial issue occurs. This avoids any unintended side effects in other browsers.

after-fix

I’ve tested the fix across all adapters on Chrome/Safari/Firefox on macOS and Chrome/Safari on iOS, and everything is functioning as expected.

@pedroborges pedroborges added the core Related to the core Inertia library label Sep 27, 2024
@pedroborges pedroborges merged commit 8d27e5c into master Oct 1, 2024
7 checks passed
@pedroborges pedroborges deleted the fix-history-navigation branch October 1, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to the core Inertia library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants