diff --git a/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m b/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m index e8111112699eed..6dfaef461d566d 100644 --- a/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +++ b/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m @@ -86,7 +86,7 @@ - (void)setReactBorderInsets:(UIEdgeInsets)reactBorderInsets { [super setReactBorderInsets:reactBorderInsets]; // We apply `borderInsets` as `_scrollView` layout offset on mac. - _scrollView.frame = UIEdgeInsetsInsetRect(self.frame, reactBorderInsets); + _scrollView.frame = UIEdgeInsetsInsetRect(self.bounds, reactBorderInsets); [self setNeedsLayout]; } #endif // ]TODO(macOS ISS#2323203) diff --git a/Libraries/Text/TextInput/Multiline/RCTUITextView.m b/Libraries/Text/TextInput/Multiline/RCTUITextView.m index 522fc5c794ba7e..e0f34464d9e1ea 100644 --- a/Libraries/Text/TextInput/Multiline/RCTUITextView.m +++ b/Libraries/Text/TextInput/Multiline/RCTUITextView.m @@ -56,7 +56,14 @@ - (instancetype)initWithFrame:(CGRect)frame self.backgroundColor = [RCTUIColor clearColor]; // TODO(macOS ISS#2323203) self.textColor = [RCTUIColor blackColor]; // TODO(macOS ISS#2323203) // This line actually removes 5pt (default value) left and right padding in UITextView. +#if !TARGET_OS_OSX // TODO(macOS ISS#2323203) self.textContainer.lineFragmentPadding = 0; +#else + // macOS has a bug where setting this to 0 will cause the scroll view to scroll to top when + // inserting a newline at the bottom of a NSTextView when it has more rows than can be displayed + // on screen. + self.textContainer.lineFragmentPadding = 1; +#endif #if !TARGET_OS_OSX && !TARGET_OS_TV // TODO(macOS ISS#2323203) self.scrollsToTop = NO; #endif