From a559b61056484323e260e0410144496c2d992feb Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 14 Mar 2019 09:28:23 -0400 Subject: [PATCH] Fix keyboard return behavior in attachment approval. --- .../AttachmentApproval/AttachmentCaptionToolbar.swift | 10 +--------- .../ImageEditor/ImageEditorTextViewController.swift | 1 - 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentCaptionToolbar.swift b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentCaptionToolbar.swift index 56b068c89..0187053d9 100644 --- a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentCaptionToolbar.swift +++ b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentCaptionToolbar.swift @@ -107,7 +107,6 @@ class AttachmentCaptionToolbar: UIView, UITextViewDelegate { lazy var textView: UITextView = { let textView = buildTextView() - textView.returnKeyType = .done textView.scrollIndicatorInsets = UIEdgeInsets(top: 5, left: 0, bottom: 5, right: 3) 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 - // 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 - } + return true } // MARK: - Helpers diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorTextViewController.swift b/SignalMessaging/Views/ImageEditor/ImageEditorTextViewController.swift index b99dfee94..f4814c540 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorTextViewController.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorTextViewController.swift @@ -213,7 +213,6 @@ public class ImageEditorTextViewController: OWSViewController, VAlignTextViewDel textView.isOpaque = false // We use a white cursor since we use a dark background. textView.tintColor = .white - textView.returnKeyType = .done // TODO: Limit the size of the text? // textView.delegate = self textView.isScrollEnabled = true