Skip to content

Commit

Permalink
[fix] made shouldChangeTextIn respect delegate value
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Tertyshnyi committed Apr 19, 2021
1 parent 11df653 commit 59231a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/MentionListener.swift
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,10 @@ extension MentionListener /* Private */ {
extension MentionListener: UITextViewDelegate {
public func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange,
replacementText text: String) -> Bool {
_ = delegate?.textView?(textView, shouldChangeTextIn: range, replacementText: text)
let delegateResult = delegate?.textView?(textView, shouldChangeTextIn: range, replacementText: text)
guard delegateResult ?? true else {
return false
}

textView.typingAttributes = defaultTextAttributes.dictionary

Expand Down

0 comments on commit 59231a4

Please sign in to comment.