Bring back interactive keyboard dismissal on compose screen
This commit is contained in:
parent
0960699699
commit
f9c3ad5921
|
@ -89,7 +89,7 @@ struct ComposeView: View {
|
|||
ScrollView(.vertical) {
|
||||
mainStack(outerMinY: outer.frame(in: .global).minY)
|
||||
}
|
||||
.scrollDismissesKeyboard(.interactively)
|
||||
.scrollDismissesKeyboardInteractivelyIfAvailable()
|
||||
}
|
||||
|
||||
if let poster = poster {
|
||||
|
@ -251,6 +251,18 @@ struct ComposeView: View {
|
|||
}
|
||||
}
|
||||
|
||||
private extension View {
|
||||
@available(iOS, obsoleted: 16.0)
|
||||
@ViewBuilder
|
||||
func scrollDismissesKeyboardInteractivelyIfAvailable() -> some View {
|
||||
if #available(iOS 16.0, *) {
|
||||
self.scrollDismissesKeyboard(.interactively)
|
||||
} else {
|
||||
self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//struct ComposeView_Previews: PreviewProvider {
|
||||
// static var previews: some View {
|
||||
// ComposeView()
|
||||
|
|
Loading…
Reference in New Issue