Skip to content

Commit 0afba0e

Browse files
swrobelfacebook-github-bot
authored andcommitted
Restore refresh spinner fix (#30978)
Summary: Fixes #30912 Reverts #31024 which did not fix the issue This fix was removed in #28236, however it caused bug #7976 to resurface, as reported in #30912 Pull Request resolved: #30978 Test Plan: This code had been present for quite some time before being removed in #28236 ## Changelog [Internal] [fixed] - regression with refresh control Reviewed By: p-sun Differential Revision: D26981600 Pulled By: PeteTheHeat fbshipit-source-id: 2560e7dba1cfd6ed41d98f2c9ff4cd07a0e5fa24
1 parent e194018 commit 0afba0e

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

React/Views/RefreshControl/RCTRefreshControl.m

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ - (void)layoutSubviews
4343
[super layoutSubviews];
4444
[self _applyProgressViewOffset];
4545

46+
// Fix for bug #7976
47+
if (self.backgroundColor == nil) {
48+
self.backgroundColor = [UIColor clearColor];
49+
}
50+
4651
// If the control is refreshing when mounted we need to call
4752
// beginRefreshing in layoutSubview or it doesn't work.
4853
if (_currentRefreshingState && _isInitialRender) {
@@ -51,18 +56,6 @@ - (void)layoutSubviews
5156
_isInitialRender = false;
5257
}
5358

54-
- (void)didMoveToWindow
55-
{
56-
[super didMoveToWindow];
57-
58-
// Since iOS 14 there seems to be a bug where refresh control becomes
59-
// visible if the view gets removed from window then added back again.
60-
// Calling endRefreshing fixes the layout.
61-
if (!_currentRefreshingState) {
62-
[super endRefreshing];
63-
}
64-
}
65-
6659
- (void)beginRefreshingProgrammatically
6760
{
6861
UInt64 beginRefreshingTimestamp = _currentRefreshingStateTimestamp;

0 commit comments

Comments
 (0)