How do I remove jump out of view appearing animation?

I have a simple SwiftUI View that is used for a macOS form. The user can select a option to show/hide detail in the form. I am trying to show this detail using an animation, similar to switching between options in the settings app. The form should grow/shrink as the detail is show, and the detail view(s) should animate in.


The code below illustrates my problem. Toggling the "Show Detail" toggle shows and hides the "Detail" Text but it also causes the. position of "Main Text" and the toggle itself to jump, and then animate back in to position.


I could fix the "jump" by making the form a fixed size, but that is what I do not want.


How do I fix this jump in the animation?


struct ContentView: View {
  @State var showDetail: Bool = true
  var body: some View {
    VStack {
      Toggle(isOn: $showDetail.animation(.easeInOut), label: { Text("Show Detail") })
      
      Divider()
      
      Text("Main Text")
        .font(.title)
      
      if showDetail {
        Text("Detail")
          .font(.subheadline)
      }
    }
  }
}
How do I remove jump out of view appearing animation?
 
 
Q