I expect this to be fixed as its already identified by Apple as a bug as mentiond by BabyJ.
For the time being you may reset selectedTeam back to nil with a button defined somewhere in your ViewBuilder closure that sets up the sidebar. (For testing purposes of NavigationSplitView). This allows to trigger a new Navigation after the reset.
My observations were the following:
Navigating back from the detail view triggers a navigation and sets selectedPlayers back to nil
Navigating back from the content view triggers a navigation back but does NOT set selectedTeam back to nil. This also explains why a team is still selected after navigation back to the sidebar view.
The missing reset to nil of selectedTeam also is the reason why it is not possible to detect a back navigation to the sidebar programmatically and the button to reset selectedTeam back to nil was the only option for me. Hopefully this gets fixed till the release of iOS 16, to be able to use NavigationSplitView accross all device types and size classes.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: