Skip to content

Commit c7cb4e7

Browse files
committed
Update comment, use reactSuperviews as starting point to support Paper
1 parent ed4bafc commit c7cb4e7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ios/RNSScreen.mm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -804,17 +804,18 @@ - (void)willMoveToWindow:(UIWindow *)newWindow
804804
// To avoid glitches resulting from clicking buttons mid transition, we temporarily disable all interactions
805805
// Disabling interactions for parent navigation controller won't be enough in case of nested stack
806806
// Furthermore, a stack put inside a modal will exist in an entirely different hierarchy
807-
// To be sure, we block interactions on the whole window.
808-
// Note that newWindows is nil when moving from instead of moving to, and Obj-C handles nil correctly
809-
[RNSScreenView.viewInteractionManagerInstance disableInteractionsForSubtreeWith:self];
807+
808+
// Use RNSViewInteractionManager util to find a suitable subtree to disable interations on,
809+
// starting from reactSuperview, because on Paper, self is not attached yet.
810+
[RNSScreenView.viewInteractionManagerInstance disableInteractionsForSubtreeWith:self.reactSuperview];
810811
}
811812
}
812813

813814
- (void)presentationControllerWillDismiss:(UIPresentationController *)presentationController
814815
{
815816
if (@available(iOS 26, *)) {
816817
// Disable interactions to disallow multiple modals dismissed at once; see willMoveToWindow
817-
[RNSScreenView.viewInteractionManagerInstance disableInteractionsForSubtreeWith:self];
818+
[RNSScreenView.viewInteractionManagerInstance disableInteractionsForSubtreeWith:self.reactSuperview];
818819
}
819820

820821
#if !RCT_NEW_ARCH_ENABLED

0 commit comments

Comments
 (0)