title: How to prevent TextField from disappearing in SwiftUI List?
body: <p>There's a nasty SwiftUI bug in which a <code>TextField</code> disappears if placed in a <code>HStack</code> within a <code>List</code></p>
  
  <pre><code>List {
      ForEach(0...200, id: \.self) { index in
          HStack {
              Text("Text \(index)")
              TextField("Test", text: .constant("TextField \(index)"))
          }
      }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/HARDF.png" alt=""></p>
  
  <p><a href="https://recordit.co/X12uGct7gD" rel="nofollow noreferrer">https://recordit.co/X12uGct7gD</a></p>
  
  <p>This happens when <code>TextField</code> is placed within a <code>HStack / VStack / ZStack / .overlay() / .background()</code>. It does not happen when <code>TextField</code> is the only child of <code>ForEach</code>.</p>
  
  <p>I have filed a bug (FB7500885) but I'm looking for ideas from the community to work around it. Here is what I've tried so far:</p>
  
  <ul>
  <li>Setting an explicit <code>.frame()</code> on <code>TextField</code></li>
  <li>Setting <code>.fixedSized()</code> on <code>TextField</code></li>
  <li>Using a <code>UITextField</code> wrapped in a <code>UIViewConvertible</code>, with or without layout constraints</li>
  </ul>
  
  <p>Is there anything else I could try?</p>