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

Have tapping on a Tab button take you to the initial scene #55

Closed
jbkuczma opened this issue Mar 27, 2018 · 2 comments
Closed

Have tapping on a Tab button take you to the initial scene #55

jbkuczma opened this issue Mar 27, 2018 · 2 comments
Assignees
Milestone

Comments

@jbkuczma
Copy link
Owner

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

@jbkuczma 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
@jbkuczma jbkuczma added this to the v2.3 milestone Apr 18, 2018
@jbkuczma
Copy link
Owner Author

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
@jbkuczma
Copy link
Owner Author

side effect noted in comment:

  • standings tab -> team -> team games -> select a game [1] -> scores tab -> select new game [2] -> standings tab
  • should be back at the game selected as [1]
  • game [1] team colors are now the team colors from game [2]

placing this issue on hold and creating a new issue for the problem described above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant