mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
fix: restore refresh control fix
This commit is contained in:
@@ -41,6 +41,11 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
||||
{
|
||||
[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) {
|
||||
@@ -49,18 +54,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
||||
_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;
|
||||
|
||||
Reference in New Issue
Block a user