react-native-macos/React/Views
Janic Duplessis e67811e7a6 Fix RefreshControl layout when removed from window (#31024)
Summary:
Since iOS 14 refresh control is sometimes visible when it shouldn't. It seems to happen when it is removed and added back to the window. This repros easily when using react-native-screens with react-navigation tabs. Inactive tabs are detached from the window to save resources.

Calling endRefreshing when refresh control is added to the window fixes the layout. It will also be called on first mount where it is not necessary, but should be a no-op and didn't cause any issues. I also decided to call it for all ios versions, although it is only needed on iOS 14+ to avoid forking behavior more.

## Changelog

[iOS] [Fixed] - Fix RefreshControl layout when removed from window

Pull Request resolved: https://github.com/facebook/react-native/pull/31024

Test Plan:
Before:

https://user-images.githubusercontent.com/2677334/108666197-93ea5a80-74a4-11eb-839b-8a4916967bf8.mov

After:

https://user-images.githubusercontent.com/2677334/108666223-9ea4ef80-74a4-11eb-8489-4e5d257299c8.mov

Reviewed By: shergin

Differential Revision: D26590759

Pulled By: PeteTheHeat

fbshipit-source-id: b8c06068a24446b261cbeb88ff166289724031f1
2021-02-23 14:54:36 -08:00
..
RefreshControl Fix RefreshControl layout when removed from window (#31024) 2021-02-23 14:54:36 -08:00
SafeAreaView Clang format for all React Native files 2020-03-08 23:01:17 -07:00
ScrollView Apply clang-format update fixes 2021-01-09 22:11:00 -08:00
RCTActivityIndicatorView.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTActivityIndicatorView.m Clang format for all React Native files 2020-03-08 23:01:17 -07:00
RCTActivityIndicatorViewManager.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTActivityIndicatorViewManager.m Clang format for all React Native files 2020-03-08 23:01:17 -07:00
RCTAnimationType.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTAutoInsetsProtocol.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTBorderDrawing.h Clang format for all React Native files 2020-03-08 23:01:17 -07:00
RCTBorderDrawing.m Apply clang-format update fixes 2021-01-09 22:11:00 -08:00
RCTBorderStyle.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTComponent.h iOS: attach rootTag to the native component instance for easy access 2019-11-16 00:13:48 -08:00
RCTComponentData.h Fix Xcode warnings in React-Core pod (#29622) 2020-09-09 12:48:09 -07:00
RCTComponentData.m remove most of tvOS remnants from the code (#29407) 2020-09-28 21:26:41 -07:00
RCTConvert+CoreLocation.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTConvert+CoreLocation.m Apply clang-format update fixes 2021-01-09 22:11:00 -08:00
RCTConvert+Transform.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTConvert+Transform.m Fix skewX/skewY/perspective/matrix on iOS (#28863) 2020-05-11 09:01:33 -07:00
RCTDatePicker.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTDatePicker.m Daily `arc lint --take CLANGFORMAT` 2020-09-29 04:14:33 -07:00
RCTDatePickerManager.h Clang format for all React Native files 2020-03-08 23:01:17 -07:00
RCTDatePickerManager.m Make RCTEventDispatcher TurboModule-compatible 2020-10-14 02:40:10 -07:00
RCTFont.h Clang format for all React Native files 2020-03-08 23:01:17 -07:00
RCTFont.mm Clang format for all React Native files 2020-03-08 23:01:17 -07:00
RCTLayout.h Clang format for all React Native files 2020-03-08 23:01:17 -07:00
RCTLayout.m Apply clang-format update fixes 2021-01-09 22:11:00 -08:00
RCTMaskedView.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTMaskedView.m Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTMaskedViewManager.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTMaskedViewManager.m Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTModalHostView.h remove most of tvOS remnants from the code (#29407) 2020-09-28 21:26:41 -07:00
RCTModalHostView.m remove most of tvOS remnants from the code (#29407) 2020-09-28 21:26:41 -07:00
RCTModalHostViewController.h remove most of tvOS remnants from the code (#29407) 2020-09-28 21:26:41 -07:00
RCTModalHostViewController.m remove most of tvOS remnants from the code (#29407) 2020-09-28 21:26:41 -07:00
RCTModalHostViewManager.h Clang format for all React Native files 2020-03-08 23:01:17 -07:00
RCTModalHostViewManager.m Fix cannot working Modal's onDismiss. (#29882) 2020-11-13 23:56:09 -08:00
RCTModalManager.h Fix cannot working Modal's onDismiss. (#29882) 2020-11-13 23:56:09 -08:00
RCTModalManager.m Fix cannot working Modal's onDismiss. (#29882) 2020-11-13 23:56:09 -08:00
RCTPicker.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTPicker.m Apply clang-format update fixes 2021-01-09 22:11:00 -08:00
RCTPickerManager.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTPickerManager.m Fix native command dispatch from RCTLegacyViewManagerInteropComponentView 2020-08-24 10:33:56 -07:00
RCTPointerEvents.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTProgressViewManager.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTProgressViewManager.m remove most of tvOS remnants from the code (#29407) 2020-09-28 21:26:41 -07:00
RCTRootShadowView.h Add minimumSize to RCTRootView & RCTRootShadowView 2020-04-08 12:48:07 -07:00
RCTRootShadowView.m Add minimumSize to RCTRootView & RCTRootShadowView 2020-04-08 12:48:07 -07:00
RCTSegmentedControl.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTSegmentedControl.m Make RCTEventDispatcher TurboModule-compatible 2020-10-14 02:40:10 -07:00
RCTSegmentedControlManager.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTSegmentedControlManager.m feat: add custom color for iOS13 segmented control (#27643) 2020-01-06 22:19:37 -08:00
RCTShadowView+Internal.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTShadowView+Internal.m Clang format for all React Native files 2020-03-08 23:01:17 -07:00
RCTShadowView+Layout.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTShadowView+Layout.m Apply clang-format update fixes 2021-01-09 22:11:00 -08:00
RCTShadowView.h Clang format for all React Native files 2020-03-08 23:01:17 -07:00
RCTShadowView.m Apply clang-format update fixes 2021-01-09 22:11:00 -08:00
RCTSlider.h Clang format for all React Native files 2020-03-08 23:01:17 -07:00
RCTSlider.m Clang format for all React Native files 2020-03-08 23:01:17 -07:00
RCTSliderManager.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTSliderManager.m Make RCTEventDispatcher TurboModule-compatible 2020-10-14 02:40:10 -07:00
RCTSwitch.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTSwitch.m Make RCTEventDispatcher TurboModule-compatible 2020-10-14 02:40:10 -07:00
RCTSwitchManager.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTSwitchManager.m Make RCTEventDispatcher TurboModule-compatible 2020-10-14 02:40:10 -07:00
RCTTextDecorationLineType.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTView.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTView.m Small refactor to make RCTView more readable 2020-06-11 13:23:27 -07:00
RCTViewManager.h Make RCTEventDispatcher TurboModule-compatible 2020-10-14 02:40:10 -07:00
RCTViewManager.m Make RCTEventDispatcher TurboModule-compatible 2020-10-14 02:40:10 -07:00
RCTWrapperViewController.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTWrapperViewController.m Make RCTEventDispatcher TurboModule-compatible 2020-10-14 02:40:10 -07:00
UIView+Private.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
UIView+React.h Clang format for all React Native files 2020-03-08 23:01:17 -07:00
UIView+React.m Clang format for all React Native files 2020-03-08 23:01:17 -07:00