Fix keyboard return behavior in attachment approval.

pull/2/head
Matthew Chen 6 years ago
parent 660f35147f
commit a559b61056

@ -107,7 +107,6 @@ class AttachmentCaptionToolbar: UIView, UITextViewDelegate {
lazy var textView: UITextView = { lazy var textView: UITextView = {
let textView = buildTextView() let textView = buildTextView()
textView.returnKeyType = .done
textView.scrollIndicatorInsets = UIEdgeInsets(top: 5, left: 0, bottom: 5, right: 3) textView.scrollIndicatorInsets = UIEdgeInsets(top: 5, left: 0, bottom: 5, right: 3)
return textView return textView
@ -190,14 +189,7 @@ class AttachmentCaptionToolbar: UIView, UITextViewDelegate {
} }
} }
// Though we can wrap the text, we don't want to encourage multline captions, plus a "done" button return true
// allows the user to get the keyboard out of the way while in the attachment approval view.
if text == "\n" {
textView.resignFirstResponder()
return false
} else {
return true
}
} }
// MARK: - Helpers // MARK: - Helpers

@ -213,7 +213,6 @@ public class ImageEditorTextViewController: OWSViewController, VAlignTextViewDel
textView.isOpaque = false textView.isOpaque = false
// We use a white cursor since we use a dark background. // We use a white cursor since we use a dark background.
textView.tintColor = .white textView.tintColor = .white
textView.returnKeyType = .done
// TODO: Limit the size of the text? // TODO: Limit the size of the text?
// textView.delegate = self // textView.delegate = self
textView.isScrollEnabled = true textView.isScrollEnabled = true

Loading…
Cancel
Save