-
-
Couldn't load subscription status.
- Fork 592
fix(iOS): Disable second transition coming from gestures when one is in progress #3142
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
fix(iOS): Disable second transition coming from gestures when one is in progress #3142
Conversation
03a9a4c to
5394a65
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us keep in mind that being able to swipe fast and swipe from anywhere on screen to dismiss is something users will want with newest iOS if it becomes the default behavior.
## Description Resolves software-mansion/react-native-screens-labs#369, might resolve #3161, reverts #3141, #3142 This PR attempts to enable interactiveContentPopGestureRecognizer for iOS 26 to achieve native screen popping behavior. Until 26, the default was to swipe from the edge of the screen. We had the option to do fullscreen switch, which was controlled by a `fullScreenSwipeEnabled` prop. Since the default behavior has changed, this prop, along with `gestureResponseDistance`, is being ignored from now on. New iOS allows for popping multiple screens almost at once, which we still cannot support due to asynchronous nature of stack updates coming from host to JS that would create a "feedback loop" in situation like the following: host pops 1. screen + sends update, pops 2. screen + sends update -> JS acknowledges 1. update + sends updated state -> host gets 2. screen from JS and pushes it again. This PR attempts to block more than 1 pop at once by removing interactions from the whole screen. As a (desired) side effect, this also disables interactions on the screen below the one that is popped until the transition finishes. ## Changes - removed `RNSPanGestureRecognizer` from iOS 26 build and replace it with native `interactiveContentPopGestureRecognizer` - disabled all interactions when screens are in transition - updated docs ## Test code and steps to reproduce Use Test3173 to test swipe and interactions on bare screens API & compare with any other test that uses react-navigation stack, i.e Test3093. Use Test3093 with additional screenOptions: ```ts { animation: 'slide_from_bottom', animationMatchesGesture: true, } ``` to test custom animations on swipe back. --------- Co-authored-by: Kacper Kafara <kacperkafara@gmail.com>
Description
This is a followup to #3093 and #3141. We now handle repeatedly clicking back button on iOS 26, and disable interactiveContentPopGestureRecognizer which triggers without fullScreenGesture prop enabled, but it still is possible to click back button and swipe when fullScreenGesture is enabled. One possible solution is to check if transitionCoordinator is set and abort handling the gesture if it is.
Changes
Added check for transitionCoordinator == nil before allowing for gesture to be received.
Test code and steps to reproduce
Use Test3093.