I have a very simple proof of concept:
struct ContentView: View {
@State private var selectedDetent: PresentationDetent = .medium
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
}
.padding()
.sheet(isPresented: .constant(true)) {
Text("hi")
.safeAreaInset(edge: .bottom) {
TextField("", text: .constant(""))
.border(.red)
}
.presentationDetents([.medium, .large], selection: $selectedDetent)
}
}
}
However, when the text field gains focus on tap, it animates up way too high and then animates back down to the keyboard height cause this really nasty looking jump. Because this is such a simple example, I suspect this is a bug in SwiftUI when combining multiple presentation detents and a focused text field but I wanted to check with the community first before I filed the feedback with Apple in case I'm doing something silly.