diff --git a/ios/inputAttributesManager/InputAttributesManager.mm b/ios/inputAttributesManager/InputAttributesManager.mm index cd768339a..829f7ca5e 100644 --- a/ios/inputAttributesManager/InputAttributesManager.mm +++ b/ios/inputAttributesManager/InputAttributesManager.mm @@ -152,6 +152,11 @@ - (void)manageTypingAttributesWithOnlySelection:(BOOL)onlySelectionChanged { // Typing attributes get reset (except alignment) when only selection changed // to an empty line (or empty line with newline). if (onlySelectionChanged) { + // if there is no content, there is no need to clear the typing attributes + if (textView.textStorage.string.length == 0) { + return; + } + NSRange paragraphRange = [textView.textStorage.string paragraphRangeForRange:selectedRange]; // User changed selection to an empty line (or empty line with a newline).