-
Notifications
You must be signed in to change notification settings - Fork 46
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
Have tapping on a Tab button take you to the initial scene #55
Comments
jbkuczma
changed the title
Have tapping on a Tab button take you to the intial scene
Have tapping on a Tab button take you to the initial scene
Mar 27, 2018
The following works as intended BUT there is a bug tabBarOnPress: ({ scene, jumpToIndex }) => {
console.log('onPress:', scene);
if (scene.route.index !== 0) {
navigation.popToTop()
} else {
jumpToIndex(scene.index)
}
} BUG: standings -> team -> games -> game -> scores tab -> game -> tap scores tab and then standings (can't view standings tab) |
jbkuczma
added a commit
that referenced
this issue
Apr 26, 2018
…the intial route. see NOTE in comment
side effect noted in comment:
placing this issue |
This was referenced Apr 26, 2018
jbkuczma
added a commit
that referenced
this issue
May 18, 2018
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In other apps when you tap on a tab button it will perform a function (ex: Instagram: search for a user, click their profile, click search tab button takes you back to the initial search screen).
When you click the tab button while in a nested scene for that tab, you should go back to the root scene (ex: Scores screen -> game -> boxscore -> * tap scores tab button * -> back to Scores screen).
Something along the lines of the following would go in
navigationOptions({...})
of the tab navigator:tabBarOnPress: (scene, jumpToIndex) => { console.log('onPress:', scene) }
source: https://reactnavigation.org/docs/tab-navigator.html#tabbaronpress
The text was updated successfully, but these errors were encountered: