Skip to content

Commit e341489

Browse files
nnabinhfacebook-github-bot
authored andcommitted
Fix spinner is not shown on beginRefreshingProgrammatically on IOS (#27397)
Summary: It closes #24855 In the endRefreshProgrammatically of RCTRefreshControl.m there is calculation for content offset when spinner is shown CGPoint offset = {scrollView.contentOffset.x, scrollView.contentOffset.y - self.frame.size.height}; However self.frame.size.height is always 0 and therefore spinner is not visible This change should fix that Since the owner of the following PR is quite busy and won't be able to resolve the merge conflict anytime soon, I created this PR here to get the fix merged soon. Ref: #27236 Thanks to [IgnorancePulls](https://github.com/IgnorancePulls) ## Changelog [iOS] [Fixed] - Fix spinner visibility on beginRefreshingProgrammatically Pull Request resolved: #27397 Test Plan: IOS tests passed Check whether this issue is reproduced or not for the repro which is described inside the issue. #24855 Reviewed By: sammy-SC Differential Revision: D18801307 Pulled By: hramos fbshipit-source-id: d12af236778441a136dbe6b03dfd3495a465ae0f
1 parent 898b1db commit e341489

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

React/Views/RefreshControl/RCTRefreshControl.m

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ - (void)beginRefreshingProgrammatically
6161
_refreshingProgrammatically = YES;
6262
// When using begin refreshing we need to adjust the ScrollView content offset manually.
6363
UIScrollView *scrollView = (UIScrollView *)self.superview;
64+
// Fix for bug #24855
65+
[self sizeToFit];
6466
CGPoint offset = {scrollView.contentOffset.x, scrollView.contentOffset.y - self.frame.size.height};
6567

6668
// `beginRefreshing` must be called after the animation is done. This is why it is impossible

0 commit comments

Comments
 (0)