title: SwifUI activates all available indices in ForEach
body: <p>I have a problem programmatically opening and closing a View in SwiftUI:</p>
  <p>With the code below SwiftUI opens each index of contactsArray one after another, when clicking on one of them (it loops through all of them). Of course it should just open the one I clicked on.</p>
  <p>I thought the problem might rely on the id but my Model is Identifiable.</p>
  <p>ContactsView:</p>
  <pre><code>               // ...
                  List {
                      ForEach(contactsViewModel.contactsArray, id: \.self) {
                          contact in
                          NavigationLink(destination: ContactsDetailsView(contact: contact), isActive: self.$userViewModel.showContacts) {
                              Text(contact.surname).bold() + Text(&quot;, &quot;) + Text(contact.forename)
                          }
                      }
                  }
  </code></pre>
  <p>ContactsViewModel:</p>
  <pre><code>final class ContactsViewModel: ObservableObject {    
     @Published var contactsArray: [ContactModel] = []
     // ...
  }
  </code></pre>
  <p>ContactModel:</p>
  <pre><code>struct ContactModel: Decodable, Identifiable, Equatable, Hashable, Comparable {
      var id: String
      var surname: String
      var forename: String
      var telephone: String
      var email: String
      var picture: String
      var gender: String
      var department: String
      
      static func &lt; (lhs: ContactModel, rhs: ContactModel) -&gt; Bool {
          if lhs.surname != rhs.surname {
              return lhs.surname &lt; rhs.surname
          } else {
              return lhs.forename &lt; rhs.forename
          }
      }
      
      static func == (lhs: ContactModel, rhs: ContactModel) -&gt; Bool {
          return lhs.surname == rhs.surname  &amp;&amp; lhs.forename == rhs.forename
      }
  }
  </code></pre>