Skip to content

Commit

Permalink
Restore refresh spinner fix
Browse files Browse the repository at this point in the history
Fixes facebook#30912

Reverts facebook#31024 which was not shown to fix the issue
  • Loading branch information
swrobel committed Mar 10, 2021
1 parent 81c895f commit ccdb305
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions React/Views/RefreshControl/RCTRefreshControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ - (void)layoutSubviews
{
[super layoutSubviews];

// Fix for bug #7976
if (self.backgroundColor == nil) {
self.backgroundColor = [UIColor clearColor];
}

// If the control is refreshing when mounted we need to call
// beginRefreshing in layoutSubview or it doesn't work.
if (_currentRefreshingState && _isInitialRender) {
Expand All @@ -49,18 +54,6 @@ - (void)layoutSubviews
_isInitialRender = false;
}

- (void)didMoveToWindow
{
[super didMoveToWindow];

// Since iOS 14 there seems to be a bug where refresh control becomes
// visible if the view gets removed from window then added back again.
// Calling endRefreshing fixes the layout.
if (!_currentRefreshingState) {
[super endRefreshing];
}
}

- (void)beginRefreshingProgrammatically
{
UInt64 beginRefreshingTimestamp = _currentRefreshingStateTimestamp;
Expand Down

0 comments on commit ccdb305

Please sign in to comment.