You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When switching between tabs a web view is always reloaded via a .restore visit.
Session line 260, introduced in turbo-ios PR #189, assumes a single navigation controller which then triggers the restoration visit. This occurs from HotwireWebViewController.viewWillAppear(_:) being called before the web view appears when switching between tabs.
Demo.mov
Replace "switching tabs" with any native to web interaction - I'm only using tabs here because that's where I noticed the issue. But this would also occur if you had a split view controller or similar - anytime viewWillAppear(_:) would be called on the view controller.
To reproduce
Create a new Xcode project
Add the Hotwire Native iOS dependency
Replace SceneDelegate.swift with code below
Set a breakpoint on Session line 260
Switch to the native tab then back to the web tab
Observe that the break point is hit and the page is reloaded
Thanks for posting this @joemasilotti. I recently upgraded the Turbo Native app at my company from turbo-ios to hotwire-native-ios, which also uses tabs, and I'm encountering this exact issue.
Ideally, we'd like users to switch between tabs without changing the state when revisiting a tab for a more seamless experience in our app.
When switching between tabs a web view is always reloaded via a
.restore
visit.Session
line 260, introduced in turbo-ios PR #189, assumes a single navigation controller which then triggers the restoration visit. This occurs fromHotwireWebViewController.viewWillAppear(_:)
being called before the web view appears when switching between tabs.Demo.mov
Replace "switching tabs" with any native to web interaction - I'm only using tabs here because that's where I noticed the issue. But this would also occur if you had a split view controller or similar - anytime
viewWillAppear(_:)
would be called on the view controller.To reproduce
SceneDelegate.swift
with code belowSession
line 260The text was updated successfully, but these errors were encountered: