diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index 281c5ea88b53..8ee9325bf5a0 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -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(*_props).multiline + : [_backedTextInputView isKindOfClass:[UITextView class]]; if (!isMultiline) { focusRect.size.height += kSingleLineKeyboardBottomOffset; } @@ -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(*_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.