title: How to automatically collapse DatePicker in a form when other field is being edited?
body: <p>I got a simple SwiftUI view:</p>
  
  <pre><code>import SwiftUI
  
  struct AddItemView: View {
      @State private var title = ""
      @State private var date = Date()
  
      var body: some View {
          Form {
              Section {
                  TextField("Title", text: $title)
                  DatePicker(
                      selection: $date,
                      in: Date()...,
                      displayedComponents: .date,
                      label: { Text("Date") }
                  )
              }
          }
      }
  }
  
  struct AddItemView_Previews: PreviewProvider {
      static var previews: some View {
          AddItemView()
      }
  }
  </code></pre>
  
  <p>I am trying to achieve the following:<br>
  If <code>DatePicker</code> is expanded (user tapped date picker, picker showing wheel to select date) and then starts typing text in <code>TextField</code>, <code>DatePicker</code> should automatically switch to initial, minimized mode (just showing label and selected date). Please take a look at screenshot. This is a behaviour in a stock Calendar.app, for example, when creating events.</p>
  
  <p><a href="https://i.stack.imgur.com/CfkcS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CfkcS.png" alt="enter image description here"></a></p>
  
  <p>Any help appreciated, thank you.</p>