From 4282ca1e02fd0498e95907cd29c9b911e4649248 Mon Sep 17 00:00:00 2001 From: Krystian Sienkiewicz Date: Tue, 8 Sep 2026 15:37:50 +0200 Subject: [PATCH] fix: don't clear typing attributes on empty editor focus --- ios/inputAttributesManager/InputAttributesManager.mm | 5 +++++ 1 file changed, 5 insertions(+) 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).