|
@@ -177,10 +177,13 @@ static NSString *const MessageHanderName = @"ReactNative";
|
177
|
177
|
// Additional viewport checks to prevent unintentional scrolls
|
178
|
178
|
UIScrollView *scrollView = self.webView.scrollView;
|
179
|
179
|
double maxContentOffset = scrollView.contentSize.height - scrollView.frame.size.height;
|
180
|
|
- if(scrollView.contentOffset.y > maxContentOffset) {
|
|
180
|
+ if (maxContentOffset < 0) {
|
|
181
|
+ maxContentOffset = 0;
|
|
182
|
+ }
|
|
183
|
+ if (scrollView.contentOffset.y > maxContentOffset) {
|
181
|
184
|
// https://stackoverflow.com/a/9637807/824966
|
182
|
185
|
[UIView animateWithDuration:.25 animations:^{
|
183
|
|
- self.webView.scrollView.contentOffset = CGPointMake(0, maxContentOffset);
|
|
186
|
+ scrollView.contentOffset = CGPointMake(0, maxContentOffset);
|
184
|
187
|
}];
|
185
|
188
|
}
|
186
|
189
|
}
|