I am trying to present a view as bottom sheet but it is behaving weirdly while closing the view using drag down. Whenever the keyboard is active it crops the view while dragging down but when keyboard is not active it behaves perfectly. I want to stop this cropping view when dropping down. You can more under stand in the GIFs.
When keyboard is not active [This what I want achieve when keyboard is active]:
When keyboard is active [Focus on edges of sheet] :
I have tried changing method of presenting but using SwiftUIX and iOS 16 sheet modifier. But I have not found the cause of this. And I am not getting any idea why this is happening and yes this behaviour only reproduces in iOS 16.
struct ContentView: View {
@State var presented: Bool = false
var body: some View {
Button("Show",action: {
presented.toggle()
})
.ignoresSafeArea()
.sheet(isPresented: $presented) {
view2
}
}
private var view2: some View {
VStack(spacing: 0) {
TextField(text: .constant("123"))
.frame(height: 70)
.background(.gray)
.padding()
TextField(text: .constant("456"))
.frame(height: 70)
.background(.gray)
.padding()
Spacer()
}
.ignoresSafeArea()
.background(.black)
}
}