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
In Hotwire Native iOS, visiting the same page that is currently being displayed will automatically replace it. On Hotwire Native Android, this pushes a new screen onto the stack.
Same is true for when visiting a page that is exactly the same as the previous one on the stack.
My mistake! The library is indeed replacing the screen when the same page is visited.
However, it plays the same animation as if you were pushing a new screen on the stack. Which confused me.
It seems that the correct animation plays when using data-turbo-action="replace" and when visiting the same page via a link tap. But it plays the "wrong" animation when submitting a form that navigates to the same page that was previously shown.
You can replicate this in the demo server with the following diff:
Then tapping "Load a webpage modally" and then "Submit Form". The home page should animate in via a fade animation but instead is pushed onto the stack.
In Hotwire Native iOS, visiting the same page that is currently being displayed will automatically replace it. On Hotwire Native Android, this pushes a new screen onto the stack.
Same is true for when visiting a page that is exactly the same as the previous one on the stack.
Here is the relevant iOS code that handles both of these scenarios:
https://github.com/hotwired/hotwire-native-ios/blob/main/Source/Turbo/Turbo%20Navigator/TurboNavigationHierarchyController.swift#L114-L131
The text was updated successfully, but these errors were encountered: