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) {
|
ScrollView(.vertical) {
|
||||||
mainStack(outerMinY: outer.frame(in: .global).minY)
|
mainStack(outerMinY: outer.frame(in: .global).minY)
|
||||||
}
|
}
|
||||||
.scrollDismissesKeyboard(.interactively)
|
.scrollDismissesKeyboardInteractivelyIfAvailable()
|
||||||
}
|
}
|
||||||
|
|
||||||
if let poster = poster {
|
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 {
|
//struct ComposeView_Previews: PreviewProvider {
|
||||||
// static var previews: some View {
|
// static var previews: some View {
|
||||||
// ComposeView()
|
// ComposeView()
|
||||||
|
|
Loading…
Reference in New Issue