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
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ - (void)reactUpdateResponderOffsetForScrollView:(RCTScrollViewComponentView *)sc
} else {
// Focus on text selection frame
focusRect = selection.rect;
BOOL isMultiline = [_backedTextInputView isKindOfClass:[UITextView class]];
BOOL isMultiline = _props ? static_cast<const TextInputProps &>(*_props).multiline
: [_backedTextInputView isKindOfClass:[UITextView class]];
if (!isMultiline) {
focusRect.size.height += kSingleLineKeyboardBottomOffset;
}
Expand Down Expand Up @@ -859,7 +860,8 @@ - (void)_setAttributedString:(NSAttributedString *)attributedString
// A single-line input that is not being edited has no cursor to keep: UIKit places one when editing begins.
// Restoring it anyway makes UIKit scroll the field editor to it when the text doesn't fit, and the editor keeps
// that offset after the text fits again, so text typed later in this view (also after recycling) is drawn too high.
BOOL isMultiline = [_backedTextInputView isKindOfClass:[UITextView class]];
BOOL isMultiline = _props ? static_cast<const TextInputProps &>(*_props).multiline
: [_backedTextInputView isKindOfClass:[UITextView class]];
if (isMultiline || _backedTextInputView.isFirstResponder) {
// Updating the UITextView attributedText, for example changing the lineHeight, the color or adding
// a new paragraph with \n, causes the cursor to move to the end of the Text and scroll.
Expand Down
Loading