forked from shadowfacts/Tusker
Fix keyboard getting dismissed when scrolling autocomplete suggestions
Presentation controller takes care of dismissing keyboard when swipe down in main scroll view starts
This commit is contained in:
parent
eccb1043db
commit
57cb0614a9
|
@ -65,7 +65,6 @@ struct ComposeView: View {
|
||||||
|
|
||||||
autocompleteSuggestions
|
autocompleteSuggestions
|
||||||
}
|
}
|
||||||
.onAppear(perform: self.didAppear)
|
|
||||||
.navigationBarTitle("Compose")
|
.navigationBarTitle("Compose")
|
||||||
.actionSheet(isPresented: $uiState.isShowingSaveDraftSheet, content: self.saveAndCloseSheet)
|
.actionSheet(isPresented: $uiState.isShowingSaveDraftSheet, content: self.saveAndCloseSheet)
|
||||||
.alert(isPresented: $isShowingPostErrorAlert) {
|
.alert(isPresented: $isShowingPostErrorAlert) {
|
||||||
|
@ -154,11 +153,6 @@ struct ComposeView: View {
|
||||||
.disabled(!postButtonEnabled)
|
.disabled(!postButtonEnabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
private func didAppear() {
|
|
||||||
let proxy = UIScrollView.appearance(whenContainedInInstancesOf: [ComposeHostingController.self])
|
|
||||||
proxy.keyboardDismissMode = .interactive
|
|
||||||
}
|
|
||||||
|
|
||||||
private func cancel() {
|
private func cancel() {
|
||||||
if Preferences.shared.automaticallySaveDrafts {
|
if Preferences.shared.automaticallySaveDrafts {
|
||||||
// draft is already stored in drafts manager, drafts manager is saved by ComposeHostingController.viewWillDisappear
|
// draft is already stored in drafts manager, drafts manager is saved by ComposeHostingController.viewWillDisappear
|
||||||
|
|
Loading…
Reference in New Issue