Skip to content
Permalink
Browse files

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
  • Loading branch information...
nicklockwood authored and facebook-github-bot-6 committed Dec 2, 2015
1 parent c06efc0 commit 6d29f710e1e22e9a6a605b0b64713d85313f074a
Showing with 6 additions and 5 deletions.
  1. +6 −5 Libraries/Text/RCTTextView.m
@@ -201,10 +201,10 @@ - (void)updateFrames

- (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 @@ - (void)reactDidMakeFirstResponder

- (BOOL)resignFirstResponder
{
return [super resignFirstResponder] && [_textView resignFirstResponder];
[super resignFirstResponder];
return [_textView resignFirstResponder];
}

- (void)layoutSubviews

0 comments on commit 6d29f71

Please sign in to comment.
You can’t perform that action at this time.