Skip to content

Conversation

@kmichalikk
Copy link
Collaborator

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.

@kmichalikk kmichalikk requested a review from t0maboro August 18, 2025 10:17
@kmichalikk kmichalikk force-pushed the @kmichalikk/fullscreen-pop-gesture-fix-ios-26 branch from 03a9a4c to 5394a65 Compare August 19, 2025 05:24
Copy link
Member

@WoLewicki WoLewicki left a 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.

@kmichalikk kmichalikk merged commit c737cfb into main Aug 19, 2025
6 checks passed
@kmichalikk kmichalikk deleted the @kmichalikk/fullscreen-pop-gesture-fix-ios-26 branch August 19, 2025 12:11
kmichalikk added a commit that referenced this pull request Sep 23, 2025
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants