struct ContentView: View {
@State var searchText: String = ""
var body: some View {
TabView {
Tab {
NavigationStack {
List {
Text("Hello!")
Text("Hello!")
Text("Hello!")
Text("Hello!")
Text("Hello!")
Text("Hello!")
}
.navigationTitle("Have a title")
.searchable(text: $searchText, placement: .toolbar)
.searchToolbarBehavior(.minimize)
.toolbar {
DefaultToolbarItem(kind: .search, placement: .topBarTrailing)
}
}
}
}
}
}
In iOS 26, this worked no problem. In iOS 27, this leaves the search bar either unable to collapse (when pressing the close button) or in a broken state where it cannot be opened again.