React-native-navigation: [V3] Support onTabPress

Created on 3 Oct 2019  路  8Comments  路  Source: wix/react-native-navigation

I can see the request has been up before to support a custom onPress https://github.com/wix/react-native-navigation/issues/5193 to a tab to trigger something like a modal (i.e Instagram add post behavior).

Is this something that will be supported or planed?

Android iOS accepteenhancement good first task looking for contributors 馃搶 pinned

Most helpful comment

Let's make this feature happen!

Spec

We'll introduce bottomTab.selectTabOnPress options which is true by default. If it's set to false, pressing a tab won't select the tab, instead it will emit a bottomTabPressedEvent (BottomTabSelectedEvent won't be emitted).

Options

bottomTab: {
  selectTabOnPress?: boolean
}

Implementation

Listen to the press event globally

Navigation.events().registerBottomTabPressedListener(({ tabIndex, componentId }) => {

});

@guyca

I've implemented this while ago, here is the patch file , works both in IOS and Android

https://gist.github.com/N3TC4T/9c06bc789529731bd54be689f210f20a

this patch is for v4.0.6 and this pull request is included in the patch.

All 8 comments

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.

Let's make this feature happen!

Spec

We'll introduce bottomTab.selectTabOnPress options which is true by default. If it's set to false, pressing a tab won't select the tab, instead it will emit a bottomTabPressedEvent (BottomTabSelectedEvent won't be emitted).

Options

bottomTab: {
  selectTabOnPress?: boolean
}

Implementation

Listen to the press event globally

Navigation.events().registerBottomTabPressedListener(({ tabIndex, componentId }) => {

});

@guyca Awesome! Let me know if you need any help!

Any news on this feature?

Let's make this feature happen!

Spec

We'll introduce bottomTab.selectTabOnPress options which is true by default. If it's set to false, pressing a tab won't select the tab, instead it will emit a bottomTabPressedEvent (BottomTabSelectedEvent won't be emitted).

Options

bottomTab: {
  selectTabOnPress?: boolean
}

Implementation

Listen to the press event globally

Navigation.events().registerBottomTabPressedListener(({ tabIndex, componentId }) => {

});

@guyca

I've implemented this while ago, here is the patch file , works both in IOS and Android

https://gist.github.com/N3TC4T/9c06bc789529731bd54be689f210f20a

this patch is for v4.0.6 and this pull request is included in the patch.

@N3TC4T Nice. What's the thinking behind not submitting a PR for this patch? Thanks!

Was this page helpful?
0 / 5 - 0 ratings