Permalink
Browse files

ScrollView/TextInput: The amnesty of `scrollRectToVisible`

Reviewed By: javache

Differential Revision: D5414438

fbshipit-source-id: 45b6a32bc2584ed99efd1514d724e2b5ca29d8e9
  • Loading branch information...
shergin authored and facebook-github-bot committed Jul 18, 2017
1 parent f89e132 commit fa1d4e8d81a4d88f6bbca5ea410e75cbcae2c854
Showing with 14 additions and 2 deletions.
  1. +14 −2 React/Views/RCTScrollView.m
@@ -214,9 +214,21 @@ - (void)handleCustomPan:(__unused UIPanGestureRecognizer *)sender
}
}
- (void)scrollRectToVisible:(__unused CGRect)rect animated:(__unused BOOL)animated
- (void)scrollRectToVisible:(CGRect)rect animated:(BOOL)animated
{
// noop
// Limiting scroll area to an area where we actually have content.
CGSize contentSize = self.contentSize;
UIEdgeInsets contentInset = self.contentInset;
CGSize fullSize = CGSizeMake(
contentSize.width + contentInset.left + contentInset.right,
contentSize.height + contentInset.top + contentInset.bottom);
rect = CGRectIntersection((CGRect){CGPointZero, fullSize}, rect);
if (CGRectIsNull(rect)) {
return;
}
[super scrollRectToVisible:rect animated:animated];
}
/**

0 comments on commit fa1d4e8

Please sign in to comment.