Bring back interactive keyboard dismissal on compose screen

This commit is contained in:
Shadowfacts 2022-06-28 17:30:04 -07:00
parent 0960699699
commit f9c3ad5921
1 changed files with 13 additions and 1 deletions

View File

@ -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()