Issue with WatchOS 10 NavigationLink in Toolbar's topBarLeading or topBarTrailing placement

There is an issue with the NavigationStack in WatchOS 10 when used with TabView: the navigation back from a top bar NavigationLink destination can stay two or three times on the destination when trying to come back to the navigation root.

Here are the conditions for the issue to occur:

  1. TabView inside NavigationStack
  2. ToolbarItem associated with a tab from the TabView--not the whole TabView
  3. ToolbarItem placed at .topBarLeading or .topBarTrailing

Notes:

  • Wrapping the tab with a NavigationStack inside TabView fails to run
  • Placing the ToolbarItem at .bottomBar works as expected
  • Second level NavigationLink from the destination also works as expected

Is there a way to fix? Or is it a WatchOS 10 issue. Thank you!

Code to replicate the issue:

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationStack {
            TabView {
                Text("Tab 1")
                    .toolbar {
                        ToolbarItem(placement: .topBarLeading) {
                            NavigationLink() {
                                Text("Destination")
                            } label: {
                                Image(systemName: "hand.tap")
                            }
                        }
                    }
                Text("Tab 2")
            }
            .tabViewStyle(.verticalPage)
        }
    }
}

Run the app, tap the hand icon, and then tap the caret (or swipe right) to come back to the main screen. (It may require a second take to experience the issue.)

Issue applies to TabView in .verticalPage view style.

Issue with WatchOS 10 NavigationLink in Toolbar's topBarLeading or topBarTrailing placement
 
 
Q