If run this code on iOS16
keyboard will get dismissed randomly when character is typed (please see gif), whereas on iOS15
the whole lot is okay.
struct ContentView: View {
let names = ["Holly", "Josh", "Rhonda", "Ted"]
@State var textual content = ""
var physique: some View {
Listing {
Part {
ForEach(searchResults, id: .self) { title in
Textual content(title)
}
} header: {
TextField("Seek for title", textual content: $textual content)
}
}
.searchable(textual content: $textual content)
}
var searchResults: [String] {
if textual content.isEmpty {
return names
} else {
return names.filter { $0.accommodates(textual content) }
}
}
}
It occurs when content material is in a bit with a header. Is it bug from apple launched in iOS16
or am I doing one thing fallacious? Has anybody had the identical concern?