React-native-navigation: [v2] iOS's fallback gesture causes Navigation to be unavailable

Created on 18 Jul 2018  ·  23Comments  ·  Source: wix/react-native-navigation

Issue Description

This problem occurs when you use the back gesture after pop from the previous page.

Steps to Reproduce / Code Snippets / Screenshots

video record


Environment

  • React Native Navigation version:2.0.2418
  • React Native version: 0.56.0
  • Platform(s): iOS
  • Device info: Simulator && Device / iOS12 Developer Beta4&& iOS 11.4 / Debug&&Release
🏚 stale

All 23 comments

Hmm, seems to work for me ok...can you show your code?

@ujwal-setlur
This example has the same problem:https://github.com/iqysf/rnndemo
video: video

The RNNRootViewController after the push was found in the View UI Hierarchy, but it was not displayed on the device.

@iqysf i am a little confused. Where are you registering your screens? I guess you have only one screen that you push again, bit don't you need to register it?

Oh I see it in index.js

Yeah, I see the problem now. I can reproduce it in my app as well. It gets triggered when

  • first a root screen is displayed
  • then, a second screen is pushed
  • then, the second screen is popped back to the first screen
  • then, back gesture is is done on first screen
  • then, pushing second screen does not work anymore

One thing I noticed is that if I do another back gesture on the first screen, the pushed screen gets popped, and then pushing works again. So it looks like the screen does get pushed, but not displayed.

So, if you disable animations in the push, it resolves the problem:

                    Navigation.push(this.props.componentId, {
                        component: {
                            name: 'App',
                            options: {
                                animations: {
                                    push: {
                                        enable: false
                                    }
                                }
                            }
                        }
                    });

So, this has something to do with animations...

I believe this patch will fix the problem:

--- RNNNavigationStackManager.m 2018-07-19 00:46:01.000000000 -0700
+++ node_modules/react-native-navigation/lib/ios/RNNNavigationStackManager.m    2018-07-19 00:55:42.000000000 -0700
@@ -13,6 +13,7 @@
    } else {
        nvc.delegate = nil;
        nvc.interactivePopGestureRecognizer.delegate = nil;
+       nvc.interactivePopGestureRecognizer.enabled = NO;
    }

    [self performAnimationBlock:^{

I tested this on both your app and mine.

 @ujwal-setlur Yeah,I tried your patch and found no problems. thx!

This is still an issue until it gets fixed in the official code. I will issue a pull request

@iqysf, can you please reopen?

@ujwal-setlur OK

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

There has been a PR open to fix this for a long time. It's yet to be reviewed

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

I think it's very high bug(

At this moment fix for me was comment it in RNNNavigationStackManager
nvc.interactivePopGestureRecognizer.delegate = nil;
and do not use any style/customization for leftButtons

@yogevbd Hi can you check it? i pretty sure i can see same bug on v1

@yogevbd also reproduce it in wix application, app freeze =(

same issue here

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

The issue has been closed for inactivity.

Probably still not fixed. Seems to me we have two options as of now:
One is to use a version where the pop gesture is working with a bug, e.g. 2.1.3.
The second option is to use a version without the pop gesture and hence without the bug, e.g. 2.2.3.
These are not ideal, but I haven't seen a workaround anywhere for this particular issue. Anybody had any luck?

Was this page helpful?
0 / 5 - 0 ratings