Compare commits
2 Commits
eccb1043db
...
2b50609e5c
Author | SHA1 | Date |
---|---|---|
Shadowfacts | 2b50609e5c | |
Shadowfacts | 57cb0614a9 |
|
@ -59,19 +59,21 @@ struct ComposePollView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
// use .animation(nil) on the binding and .frame(maxWidth: .infinity) on labels so frame doesn't have a size change animation when the text changes
|
// use .animation(nil) on pickers so frame doesn't have a size change animation when the text changes
|
||||||
Picker(selection: $poll.multiple.animation(nil), label: Text(poll.multiple ? "Allow multiple choices" : "Single choice").frame(maxWidth: .infinity)) {
|
Picker(selection: $poll.multiple, label: Text(poll.multiple ? "Allow multiple choices" : "Single choice")) {
|
||||||
Text("Allow multiple choices").tag(true)
|
Text("Allow multiple choices").tag(true)
|
||||||
Text("Single choice").tag(false)
|
Text("Single choice").tag(false)
|
||||||
}
|
}
|
||||||
|
.animation(nil)
|
||||||
.pickerStyle(MenuPickerStyle())
|
.pickerStyle(MenuPickerStyle())
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
|
|
||||||
Picker(selection: $duration.animation(nil), label: Text(verbatim: ComposePollView.formatter.string(from: duration.timeInterval)!).frame(maxWidth: .infinity)) {
|
Picker(selection: $duration, label: Text(verbatim: ComposePollView.formatter.string(from: duration.timeInterval)!)) {
|
||||||
ForEach(Duration.allCases, id: \.self) { (duration) in
|
ForEach(Duration.allCases, id: \.self) { (duration) in
|
||||||
Text(ComposePollView.formatter.string(from: duration.timeInterval)!).tag(duration)
|
Text(ComposePollView.formatter.string(from: duration.timeInterval)!).tag(duration)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.animation(nil)
|
||||||
.pickerStyle(MenuPickerStyle())
|
.pickerStyle(MenuPickerStyle())
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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