Hi, i've noticed on mobile if a user navigates to different pages then presses the back button it actually comes out of the web app, ive noticed it on Laracasts as well, is there a way to keep history or another workaround on mobile using Inertia? Thanks
Hi, I mean, say i was on website A, i go to website B, on website B I am going to different routes, i press the back button on mobile, I am taken back to website A like the whole web app of website B was a one page SPA. Thus sending me back not to a aoge on website B but back to website A, if you get what i mean. Thanks
Nope, the website is using Laravel, Inertia, React and SSR. I tested on a new iPhone and Chrome and it works fine, on an older iOS 18 iPhone, the issues happen. I've also noted if a site is not using full SSR, it works normally even on iOS 18, but my app has SSR enabled, and it has the issue.
That sounds weird. There should be no difference between SSR and CSR in this regard. I've run both kinds without seeing any history issues.
Maybe your UI uses some JS feature or library that isn't supported on the older mobile browser, which then causes errors? The history API updates would have to fail somehow for this to happen. Have you checked if the address bar updates when you navigate between pages on site B?
This is a common gotcha when using Inertia.js on mobile browsers (especially Safari on iOS and some Android OEM browsers).
Your Inertia navigation didn’t create real browser history entries. The native back button sometimes closes the browser tab instead of navigating back through Inertia’s history.