Selection state is lost when navigating to/from home screen

Hi!

When using the Sample "NavigationCookbook" in the two column layout, the selection in the first column is not remembered, when navigating to the Home Screen and back.

This behaviour can be reproduced by starting the app on the iPad or simulator, selecting for example "Pancake" and then navigating to the home screen and back into the navigation. Sometimes this (the navigation to/back from the home screen) has to be done twice, to lose the selection. In the console log you can see the message "Update NavigationAuthority bound path tried to update multiple times per frame." appearing. Not sure if this has something todo with the selection being lost.

This is on iOS 16.4.1 not sure if the behaviour before was different. Anybody experiences the same behaviour? Bug in SwiftUI or in the sample app?

Cheers, Michael

To see if it's 16.4.1 or not, just add a new Simulator in Xcode with an earlier version (Window menu > Devices & Simulators > Simulators tab > + button at the bottom > choose a device and iOS version).

I have experienced the same exact problem. Have tried storing the selectionState to no avail - it seems the os sets selected to nil.

Selection state is lost when navigating to/from home screen
 
 
Q