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

Root scene been reset on keyboard appears #2826

Closed
macanhajc opened this issue Jan 23, 2018 · 9 comments
Closed

Root scene been reset on keyboard appears #2826

macanhajc opened this issue Jan 23, 2018 · 9 comments

Comments

@macanhajc
Copy link

Version

  • "react-native-router-flux": "^4.0.0-beta.27",
  • "react-native": "0.50.1",

I have a group of scenes in a tab with a tabBarComponent, when i go to one scene inside the tab and go to another scene with is not in the tab scene, if i open the keyboard and tap something, my current scene is forwarded and sent to my initial in stackLogin

const scenes = Actions.create(
    <Scene key="root">

        <Scene hideNavBar key="stackLogin">
            <Scene component={Inicio} key="inicio" initial={true} />
            <Scene component={Login} key="login" />
            <Scene component={Registro} key="registro" />
            <Scene component={ConclusaoRegistro} key="conclusaoRegistro" />
        </Scene>

        <Scene key="sliderProduto"
            direction="horizontal"
            component={SliderProduto}
            hideNavBar
        />

        <Scene
            key="tabFooter"
            tabs={true}
            lazy={true}
            swipeEnabled={false}
            tabBarComponent={MenuRodape}
            tabBarPosition="bottom"
            animationEnabled={false}
        >

            <Scene hideNavBar key="home" component={Home} />
            <Scene hideNavBar key="pesquisa" component={Pesquisa} />
            <Scene hideNavBar key="carrinho" component={Carrinho} />
            <Scene hideNavBar key="pessoa" component={Pessoa} />
            <Scene hideNavBar key="produto" component={Produto} lazy={true} />

        </Scene>

        <Scene hideNavBar hideTabBar key="verificaProduto" component={VerificaProduto} />

    </Scene>
);

export default class routes extends Component {
    render() {
        return (
            <Root>
                <Router scenes={scenes} />
            </Root>
        )
    };
}
@wallace7souza
Copy link

This is happening with me. On IOS it's ok but on android it's reloading the state when a textInput get focus and the keyboard appears.

@macanhajc
Copy link
Author

I fix it using type={ActionConst.RESET} on the Scene where it happens, but i'm not sure if this is the right thing to do and doing this i loose my stack and i cant use pop.

<Scene hideNavBar key="verificaProduto" component={VerificaProduto} type={ActionConst.RESET} />

@bmikaili
Copy link

bmikaili commented Jun 5, 2018

This is not a permanent fix, as the back navigation disappear when doing this.

@HessiPard
Copy link

Maybe duplicate of #2817

@bmikaili
Copy link

bmikaili commented Jun 6, 2018

Sadly calling drawerClose() before Actions.screen() didn't work.

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

Please try to reproduce it with Example project and latest version 4.0.0-beta.40. Feel free to open if the issue still exists

@aksonov aksonov closed this as completed Aug 8, 2018
@roden1999
Copy link

I have the same problem. When I press my input the keyboard will show and disappear after 1 seconds then go back to my initial route scene. How do I fix it.?

@bmikaili
Copy link

bmikaili commented Oct 5, 2018 via email

@HessiPard
Copy link

Sadly calling drawerClose() before Actions.screen() didn't work.

Use 4.0.0-beta.31.

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

6 participants