I have just started learning SwiftUI and have created a basic View as follows:
import SwiftUI
struct ContentView: View {
@State var searchText = ""
@State var items = 0...5
var body: some View {
NavigationStack {
List {
ForEach(items, id: \.self) { item in
Text("Item \(item)")
}
}
.searchable(text: $searchText)
.navigationTitle("Test items")
}
}
}
When I tap the search field and the keyboard appears, the List jumps down the screen briefly, before animating. This can be seen in the following video:
https://reddit.com/link/10tql80/video/8mjpo7c0g8ga1/player
I am using Xcode 14.2 and running the app on an iPhone 11 Pro (iOS 16.3).
I would be grateful if someone could let me know what I'm doing wrong here.
Thank you for your help in advance.
I have reduced the problem to its simplest form and the issue persists. I expect the animation to work smoothly without the content first jumping down the screen.