title: Why does a SwiftUI TextField inside a navigation bar only accept input one character at a time
body: <p>I want to allow the user to filter data in a long list to more easily find matching titles.</p>
  
  <p>I have placed a TextView inside my navigation bar:</p>
  
  <pre><code>.navigationBarTitle(Text("Library"))
  .navigationBarItems(trailing: TextField("search", text: $modelData.searchString)
  </code></pre>
  
  <p>I have an observable object which responds to changes in the search string:</p>
  
  <pre><code>class DataModel: ObservableObject {
     @Published var modelData: [PDFSummary]
     @Published var searchString = "" {
              didSet {
                  if searchString == "" {
                      modelData =  Realm.studyHallRealm.objects(PDFSummary.self).sorted(by: { $0.name &lt; $1.name })
                  } else {
                      modelData =  Realm.studyHallRealm.objects(PDFSummary.self).sorted(by: { $0.name &lt; $1.name }).filter({ $0.name.lowercased().contains(searchString.lowercased()) })
                  }
              }
          }
  </code></pre>
  
  <p>Everything works fine, except I have to tap on the field after entering each letter. For some reason the focus is taken away from the field after each letter is entered (unless I tap on a suggested autocorrect - the whole string is correctly added to the string at once)</p>