File tree Expand file tree Collapse file tree
ios/enrichedInputTextView Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,6 +56,15 @@ - (CGRect)caretRectForPosition:(UITextPosition *)position {
5656 rect.origin .x = (containerWidth - rect.size .width ) / 2.0 ;
5757 } else if (alignment == NSTextAlignmentRight) {
5858 rect.origin .x = containerWidth - rect.size .width ;
59+ } else {
60+ // when we change selection to the last empty line in the editor,
61+ // where we literally have no character there, UIKit seems to need to know
62+ // the line's expected geometry (indent) and it derives typing attributes
63+ // from the previous character (previous line). Happens even though we
64+ // explicitly didn't want that in
65+ // manageTypingAttributesWithOnlySelection:YES, so we can't trust typing
66+ // attributes' pStyle here, manually setting the caret's position
67+ rect.origin .x = 0 ;
5968 }
6069
6170 return rect;
You can’t perform that action at this time.
0 commit comments