Skip to content

Commit

Permalink
RCTRefreshControl: Updates progressOffset behaviour to prevent it fro…
Browse files Browse the repository at this point in the history
…m being applied by default
  • Loading branch information
objectivecosta committed Nov 9, 2022
1 parent 5744b21 commit b80cfb3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions React/Views/RefreshControl/RCTRefreshControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,14 @@ - (void)_applyProgressViewOffset
// the coordinate space of the RefreshControl. This ensures that the control respects any
// offset in the view hierarchy, and that progressViewOffset is not inadvertently applied
// multiple times.
UIView *scrollView = self.superview;
UIView *target = scrollView.superview;
CGPoint rawOffset = CGPointMake(0, _progressViewOffset);
CGPoint converted = [self convertPoint:rawOffset fromView:target];
self.frame = CGRectOffset(self.frame, 0, converted.y);

if (_progressViewOffset > 0.f) {
UIView *scrollView = self.superview;
UIView *target = scrollView.superview;
CGPoint rawOffset = CGPointMake(0, _progressViewOffset);
CGPoint converted = [self convertPoint:rawOffset fromView:target];
self.frame = CGRectOffset(self.frame, 0, converted.y);
}
}

- (NSString *)title
Expand Down

0 comments on commit b80cfb3

Please sign in to comment.