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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The issue seems to be the toolbar owning (and not handling properly) the navigation link.
This is what I believe it's happening:
after we push to the child, we tap the mutate button to change the binding value.
this triggers a new ContentView body evaluation (hence also a new evaluation of the toolbar)
The toolbar somehow knows that it's pushing a view, but during the new body evaluation it also forgets that it already did push the child view, so it pushes another one.
I've tried moving the push state out of NavigationLink and into the ContentView, however the behavior is still the same, hence I think this is an issue with the toolbar/NavigationLink combo.
To fix this issue, I found that moving the NavigationLink completely out of the toolbar, and into the ContentView makes it work:
The issue seems to be the toolbar owning (and not handling properly) the navigation link.
This is what I believe it's happening:
mutatebutton to change the binding value.ContentViewbody evaluation (hence also a new evaluation of thetoolbar)toolbarsomehow knows that it's pushing a view, but during the new body evaluation it also forgets that it already did push the child view, so it pushes another one.This causes the issue in your tweet.
I've tried moving the push state out of
NavigationLinkand into theContentView, however the behavior is still the same, hence I think this is an issue with the toolbar/NavigationLinkcombo.To fix this issue, I found that moving the
NavigationLinkcompletely out of the toolbar, and into theContentViewmakes it work:From the UI perspective this is identical to the previous example, however the navigation state is properly handled.