Revert "Fix: Added scroll Bounds check in scrollToOffset method in RCTScrollView on iOS"
This reverts commit 16c9e5b715
.
This commit is contained in:
parent
44f19f745b
commit
c2c4f486a2
|
@ -575,9 +575,6 @@ static inline void RCTApplyTransformationAccordingLayoutDirection(UIView *view,
|
||||||
- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated
|
- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated
|
||||||
{
|
{
|
||||||
if (!CGPointEqualToPoint(_scrollView.contentOffset, offset)) {
|
if (!CGPointEqualToPoint(_scrollView.contentOffset, offset)) {
|
||||||
CGFloat maxOffsetX = _scrollView.contentSize.width - _scrollView.bounds.size.width + _scrollView.contentInset.right;
|
|
||||||
CGFloat maxOffsetY = _scrollView.contentSize.height - _scrollView.bounds.size.height + _scrollView.contentInset.bottom;
|
|
||||||
offset = CGPointMake(MAX(0, MIN(maxOffsetX, offset.x)), MAX(0, MIN(maxOffsetY, offset.y)));
|
|
||||||
// Ensure at least one scroll event will fire
|
// Ensure at least one scroll event will fire
|
||||||
_allowNextScrollNoMatterWhat = YES;
|
_allowNextScrollNoMatterWhat = YES;
|
||||||
[_scrollView setContentOffset:offset animated:animated];
|
[_scrollView setContentOffset:offset animated:animated];
|
||||||
|
|
Loading…
Reference in New Issue