From 6cb2684b4343bd8698b9770c0f6ef8812683c783 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 13 Jan 2025 04:53:04 -0800 Subject: [PATCH] fix modal becoming unresponsive with PullToRefresh Summary: ## Changelog: [iOS] [Fixed] - Fix app becoming unresponsive when RefreshControl is used inside of Fixes: https://github.com/facebook/react-native/issues/48579 This is a UIKit bug. Switching to `didMoveToSuperview` resolves it. Reviewed By: cipolleschi Differential Revision: D68025099 fbshipit-source-id: 5d5e730f002ca93748674655a8393b770dc11611 Co-authored-by: kkafar --- .../ScrollView/RCTPullToRefreshViewComponentView.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm index 3a5679ea5dd083..e423f1880baa6f 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm @@ -144,10 +144,10 @@ - (void)_updateTitle #pragma mark - Attaching & Detaching -- (void)didMoveToWindow +- (void)didMoveToSuperview { - [super didMoveToWindow]; - if (self.window) { + [super didMoveToSuperview]; + if (self.superview) { [self _attach]; } else { [self _detach];