Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ios/enrichedInputTextView/EnrichedInputTextView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ - (CGRect)caretRectForPosition:(UITextPosition *)position {
rect.origin.x = (containerWidth - rect.size.width) / 2.0;
} else if (alignment == NSTextAlignmentRight) {
rect.origin.x = containerWidth - rect.size.width;
} else {
// when we change selection to the last empty line in the editor,
// where we literally have no character there, UIKit seems to need to know
// the line's expected geometry (indent) and it derives typing attributes
// from the previous character (previous line). Happens even though we
Comment thread
hejsztynx marked this conversation as resolved.
// explicitly didn't want that in
// manageTypingAttributesWithOnlySelection:YES, so we can't trust typing
// attributes' pStyle here, manually setting the caret's position
rect.origin.x = 0;
}

return rect;
Expand Down
Loading