Hotwire Native iOS Tab Reloading Issue

Hello,

I am new to Hotwire Native and I have a fundamental question about it. I was implementing a native tab bar following SupeRails solution here but the problem is when I switch between tabs I lost the entered inputs or my current Google Map view because it fetches the data from the rails backend when I switch the related tab. (In Superails example, when switching between tabs you reinitialized the video player each time). I see it preserve the scroll like it said in the documentation. It seems this is the default behavior but is there a way to prevent it? Or this is the nature of the Hotwire Native and I need to update my backend rendered html and js, and find a way to keep my inputs (like saving and fetching inputs from localStorage or init the map again and current position etc.)?

Thanks your answers in advance.

1 Like

in my current turbo-ios application, I am using UITabController, and switching tabs doesn’t automatically reload the web views. The issue is that if you make a POST request in tab A, then the data in tab B’s webview will be stale until you reload it. If you force the webView to reload whenever you change tabs, you fix that problem, but it creates the problem you are seeing now, where you lose the temporary state of the page. Please let me know how you fixed this issue in the end! I am also dealing with a similar issue in my application.

There was a bug that was fixed in Hotwire Native 1.1.