Skip to content

Conversation

@pedroborges
Copy link
Contributor

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.

3 participants