title: Expandable List in SwiftUI only expands once and won't contract
body: <p>I'm trying (and failing!) to implement an expandable list of questions and answers in SwiftUI. </p>
  
  <pre><code>struct FAQ: Equatable, Identifiable {
      static func ==(lhs: FAQ, rhs: FAQ) -&gt; Bool {
          return lhs.id == rhs.id
      }
      let id = UUID()
      let question: String
      let answers: [String]
      var isExpanded: Bool = false
  }
  
  struct ContentView: View {
      @State private (set) var faqs: [FAQ] = [
          FAQ(question: "What is the fastest animal on land?", answers: ["The cheetah"]),
          FAQ(question: "What colours are in a rainbox?", answers: ["Red", "Orange", "Yellow", "Blue", "Indigo", "Violet"])
      ]
  
      var body: some View {
          List {
              ForEach(faqs) { faq in
                  Section(header: Text(faq.question)
                      .onTapGesture {
                          if let index = self.faqs.firstIndex(of: faq) {
                              self.faqs[index].isExpanded.toggle()
                          }
                      }
                  ) {
                      if faq.isExpanded {
                          ForEach(faq.answers, id: \.self) {
                              Text("• " + $0).font(.body)
                          }
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>Tapping any question successfully expands the answers into view, but tapping the same header again doesn't contract the answers, nor does tapping a second question expand those answers.</p>
  
  <p><a href="https://i.stack.imgur.com/BIjdPl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BIjdPl.png" alt="enter image description here"></a></p>
  
  <p>With some judiciously placed <code>print</code>s, I can see that <code>isExpanded</code> is toggled to <code>true</code> on the first question tapped, but then won't toggle back to <code>false</code>. </p>
  
  <p><em>Could someone explain what I'm doing wrong?</em></p>