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
|
- (void)updateContentSize
|
||||||
{
|
{
|
||||||
_textView.scrollEnabled = YES;
|
CGSize size = (CGSize){_scrollView.frame.size.width, INFINITY};
|
||||||
_scrollView.contentSize = _textView.contentSize;
|
size.height = [_textView sizeThatFits:size].height;
|
||||||
_textView.frame = (CGRect){CGPointZero, _scrollView.contentSize};
|
_scrollView.contentSize = size;
|
||||||
_textView.scrollEnabled = NO;
|
_textView.frame = (CGRect){CGPointZero, size};
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updatePlaceholder
|
- (void)updatePlaceholder
|
||||||
@ -462,7 +462,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
|
|||||||
|
|
||||||
- (BOOL)resignFirstResponder
|
- (BOOL)resignFirstResponder
|
||||||
{
|
{
|
||||||
return [super resignFirstResponder] && [_textView resignFirstResponder];
|
[super resignFirstResponder];
|
||||||
|
return [_textView resignFirstResponder];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)layoutSubviews
|
- (void)layoutSubviews
|
||||||
|
Loading…
x
Reference in New Issue
Block a user