diff --git a/Aztec/Classes/TextKit/TextView.swift b/Aztec/Classes/TextKit/TextView.swift index 186429c92..b02ba55f3 100644 --- a/Aztec/Classes/TextKit/TextView.swift +++ b/Aztec/Classes/TextKit/TextView.swift @@ -178,6 +178,10 @@ open class TextView: UITextView { /// open var shouldNotifyOfNonUserChanges = true + /// If this is true the typing attributes will be recalculated when deleting backward + /// + open var shouldRecalculateTypingAttributesOnDeleteBackward = true + // MARK: - Customizable Input VC private var customInputViewController: UIInputViewController? @@ -738,7 +742,9 @@ open class TextView: UITextView { evaluateRemovalOfSingleLineParagraphAttributesAfterSelectionChange() ensureRemovalOfParagraphAttributesWhenPressingBackspaceAndEmptyingTheDocument() ensureCursorRedraw(afterEditing: deletedString.string) - recalculateTypingAttributes() + if shouldRecalculateTypingAttributesOnDeleteBackward { + recalculateTypingAttributes() + } notifyTextViewDidChange() }