Popover does not appear when closed during variable edit

I want to edit objects using popovers in my macOS application. But for some reason the popover does not appear anymore, when it was closed the popover while editing a variable. In the example bellow i've used a TextField to do that, but same happens with a DatePicker. (see gif bellow)

Any ideas, why this is happening?


https://gifyu.com/image/IF2i


import SwiftUI

struct ContentView: View {
  var body: some View {
  VStack {
  SubView()
  SubView()
  SubView()
  }.padding()
  }
}

struct SubView: View {
  @State var showPopover = false
  var body: some View {
  VStack {
  Text("Label")
  }.onTapGesture {
  self.showPopover = true
  }
  .popover(isPresented: $showPopover, arrowEdge: .trailing) {
  Popover()
  }
  }
}

struct Popover: View {

  @State var test: String = ""

  var body: some View {
  TextField("Text", text: $test)
  }
}

You should move this thread to SwiftUI section.

Did you figure it out eventually? I'm struggling with exactly the same problem now and can't find a way to fix it...
tried your code and all is working well for me on macos 11.4 beta, target ios 14.5 and Mac Catalyst and
macos 11.3, using Xcode 12.5.

You could try:
Code Block
Popover().frame(width: 222, height: 222).background(Color.green)

to make sure you can see the Popover.

What system are you using/targeting?
Popover does not appear when closed during variable edit
 
 
Q