Fix bugs with multiline TextInput (#640)

fixes #639
fixes #611
This commit is contained in:
Liron Yahdav 2020-10-28 12:05:03 -07:00 коммит произвёл GitHub
Родитель 5c4f68bb14
Коммит d9ff045ca9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -86,7 +86,7 @@
{
[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)

Просмотреть файл

@ -56,7 +56,14 @@ static RCTUIColor *defaultPlaceholderColor() // TODO(OSS Candidate ISS#2710739)
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