Every time on exit from .popover TextField (escape or .popover outside click) cursor automatically appears in search field. How to disable that cursor “jumping” behaviour for .searchable field?
import SwiftUI
struct ContentView: View {
@State private var searchText = ""
@State private var showPopoverComment = false
@State var comment: String = ""
var body: some View {
VStack {
Button("child button", action: {showPopoverComment = true})
}
.searchable(text: $searchText, placement: .toolbar, prompt: "Search")
.popover(isPresented: $showPopoverComment) {
TextEditor(text: $comment)
.frame(width: 100, height: 100)
}
}
}