Skip to content
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

Modal StackView nested inside other StackNavigator is not presented modally #690

Closed
aimak opened this issue Mar 14, 2017 · 6 comments
Closed

Comments

@aimak
Copy link

aimak commented Mar 14, 2017

Hello everyone,

I'm struggling with a complicated nesting of navigators here and it seems something does not work as I would have expected.

I have this code :

const MyApp = TabNavigator({
FirstTab: {
    screen: StackNavigator({
      ListScreen: {
        screen: ListScreen,
      },
      DetailScreen: {
        screen: DetailScreen,
      },
      ModalScreen: {
        screen: StackNavigator({
          Home: {
            screen: ModalScreen,
          },
        },{
          mode: 'modal',
        }),
      },
    }),
}

So I have ListScreen as first tab of my TabNavigator. I want the user to be able to push another component (DetailScreen) and then tap on a button that will display a ModalScreen. Sadly, when I call
this.props.navigation.navigate('ModalScreen') the screen is pushed rather than being presented modally.

The interesting part is if I add a mode: 'modal' on the FirstTab StackNavigator, then every screen of the stack is presented modally.

It also seems that if the FirstTab stack is a modal, then the nested ModalScreen is modal no mater the mode I set.

Am I doing anything wrong or is it a bug ?

I'm using "react-navigation": "^1.0.0-beta.5",

@aimak aimak changed the title Modal StackView nested inside other StackNavigator does not work Modal StackView nested inside other StackNavigator is not presented modally Mar 14, 2017
@Exilz
Copy link

Exilz commented Mar 17, 2017

Same problem here with the latest commit in master.

@nihgwu
Copy link

nihgwu commented Mar 17, 2017

#232 (comment)

@j-mendez
Copy link

having this issue as well.

@gislitg
Copy link

gislitg commented Mar 21, 2017

+1

@ericvicenti
Copy link
Contributor

This can be fixed by putting your mode: 'modal', navigator on the outside

@gregblass
Copy link

#707 (comment) - This is how I was able to accomplish loading screens as modals within a card stack navigator - basically nest a card stacknavigator within a modal stacknavigator.

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

No branches or pull requests

7 participants