Skip to content

fix(Fabric,iOS): cancel conflicting presses in modals on swipe back gesture #2943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ios/utils/UIView+RNSUtility.mm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

#import "UIView+RNSUtility.h"

#ifdef RCT_NEW_ARCH_ENABLED
#import <React/RCTSurfaceView.h>
#import "RNSModalScreen.h"
#endif

@implementation UIView (RNSUtility)
Expand All @@ -17,7 +17,10 @@ - (nullable RNS_TOUCH_HANDLER_ARCH_TYPE *)rnscreens_findTouchHandlerInAncestorCh
// hosts `RCTSurfaceTouchHandler` as a private field. When initialised, `RCTSurfaceTouchHandler` is attached to the
// surface view as a gestureRecognizer <- and this is where we can lay our hands on it.

while (parent != nil && ![parent isKindOfClass:RCTSurfaceView.class]) {
// On Fabric, every screen not mounted under react root view has it's own surface touch handler attached
// (done when the screen is moved to window).
while (parent != nil && ![parent isKindOfClass:RCTSurfaceView.class] &&
![parent isKindOfClass:RNSModalScreen.class]) {
parent = parent.superview;
}

Expand Down
Loading