From 6eaee97c533ffc77d72f1b1cce004e6837234c57 Mon Sep 17 00:00:00 2001 From: Nora Trapp Date: Tue, 4 Aug 2020 17:25:32 -0700 Subject: [PATCH] Fix an extraneous animation when typing a non-mention after @ --- SignalMessaging/Views/Mentions/MentionTextView.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SignalMessaging/Views/Mentions/MentionTextView.swift b/SignalMessaging/Views/Mentions/MentionTextView.swift index cd87d24b78..2851502513 100644 --- a/SignalMessaging/Views/Mentions/MentionTextView.swift +++ b/SignalMessaging/Views/Mentions/MentionTextView.swift @@ -248,7 +248,13 @@ open class MentionTextView: OWSTextView { let animationTopConstraint = pickerView.autoPinEdge(.top, to: .top, of: pickerReferenceView) - didUpdateMentionText(currentlyTypingMentionText ?? "") + guard let currentlyTypingMentionText = currentlyTypingMentionText, + pickerView.mentionTextChanged(currentlyTypingMentionText) else { + pickerView.removeFromSuperview() + self.pickerView = nil + state = .notTypingMention + return + } let style = mentionDelegate.textViewMentionStyle(self) if style == .composingAttachment {