I noticed that when using .searchable inside a NavigationStack thats inside a TabView, the searchbar briefly overlays the content before disappearing. After that, it is hidden and appears as expected when swiping down. This only happens when the .searchable is inside the NavigationStack, there is at least one navigationTitle and the NavigationStack is inside a TabView. Tested on simulator and real device. I would appreciate any help. Thanks!
struct FirstScreen: View {
var body: some View {
TabView {
Tab("Tab", systemImage: "heart") {
NavigationStack {
NavigationLink {
SecondScreen()
} label: {
Text("Go to second screen")
}
.navigationTitle("First Screen")
}
}
}
}
}
struct SecondScreen: View {
@State private var text: String = ""
var body: some View {
List {
Text("Some view that extends all the way to the top")
}
.searchable(text: $text)
.navigationTitle("Second Screen")
}
}