mirror of
https://github.com/status-im/react-native.git
synced 2025-02-26 08:05:34 +00:00
Fixed TextInput on iOS 8 and earlier
Summary: public The scrolling fix I added to RCTTextView doesn't work on iOS 8 because the underlying UITextField doesn't resize correctly, which breaks text input functionality. This diff fixes it. Reviewed By: tadeuzagallo Differential Revision: D2712618 fb-gh-sync-id: 1d0282df3a16f1cb6ddf9d005d640738bb1b5659
This commit is contained in:
parent
c06efc0831
commit
6d29f710e1
@ -201,10 +201,10 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
|
||||
|
||||
- (void)updateContentSize
|
||||
{
|
||||
_textView.scrollEnabled = YES;
|
||||
_scrollView.contentSize = _textView.contentSize;
|
||||
_textView.frame = (CGRect){CGPointZero, _scrollView.contentSize};
|
||||
_textView.scrollEnabled = NO;
|
||||
CGSize size = (CGSize){_scrollView.frame.size.width, INFINITY};
|
||||
size.height = [_textView sizeThatFits:size].height;
|
||||
_scrollView.contentSize = size;
|
||||
_textView.frame = (CGRect){CGPointZero, size};
|
||||
}
|
||||
|
||||
- (void)updatePlaceholder
|
||||
@ -462,7 +462,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
|
||||
|
||||
- (BOOL)resignFirstResponder
|
||||
{
|
||||
return [super resignFirstResponder] && [_textView resignFirstResponder];
|
||||
[super resignFirstResponder];
|
||||
return [_textView resignFirstResponder];
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
|
Loading…
x
Reference in New Issue
Block a user