Skip to content

Commit 4282ca1

Browse files
committed
fix: don't clear typing attributes on empty editor focus
1 parent 5a733d4 commit 4282ca1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

ios/inputAttributesManager/InputAttributesManager.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ - (void)manageTypingAttributesWithOnlySelection:(BOOL)onlySelectionChanged {
152152
// Typing attributes get reset (except alignment) when only selection changed
153153
// to an empty line (or empty line with newline).
154154
if (onlySelectionChanged) {
155+
// if there is no content, there is no need to clear the typing attributes
156+
if (textView.textStorage.string.length == 0) {
157+
return;
158+
}
159+
155160
NSRange paragraphRange =
156161
[textView.textStorage.string paragraphRangeForRange:selectedRange];
157162
// User changed selection to an empty line (or empty line with a newline).

0 commit comments

Comments
 (0)