title: SwiftUI: NavigationLink is always activated when in a List
body: <p>I can't prevent <code>SwiftUI</code>'s <code>NavigationLink</code> from being activated when in a <code>List</code>, I have this simple piece of code in which I need to do some kind of business check before deciding to show the details page or not (in a real world app, there might be some business logic happens inside the button's action):</p>
  
  <pre><code>struct ContentView: View {
      @State var showDetail = false
      var body: some View {
          NavigationView {
              List {
                  Text("Text 1")
                  Text("Text 2")
                  Text("Text 3")
                  NavigationLink(destination: DetailView(), isActive: $showDetail) {
                      LinkView(showDetails: $showDetail)
  
                  }
              }
          }
      }
  }
  
  struct LinkView: View {
      @Binding var showDetails: Bool
  
      var body: some View {
          Button(action: {
              self.showDetails = false
          }) {
              Text("Open Details")
          }
      }
  }
  
  struct DetailView: View {
      var body: some View {
          Text("Detail View")
      }
  }
  </code></pre>
  
  <p>how can I prevent navigation link from opening the details page in this case ? and is this a bug in the SDK ? </p>
  
  <p>p.s. XCode version: <code>13.3.1</code> and iOS version (real device): <code>13.3.1</code></p>
  
  <p><em>Edit</em> </p>
  
  <p>I can't replace List with <code>ScrollView</code> because I have a <code>ForEach</code> list of items in my real app, so don't post an answer considering using <code>ScrollView</code>.</p>