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

preventDefault doesn't work correctly #45

Closed
elcrostatina opened this issue May 28, 2020 · 8 comments · Fixed by #50
Closed

preventDefault doesn't work correctly #45

elcrostatina opened this issue May 28, 2020 · 8 comments · Fixed by #50
Assignees
Labels
bug Something isn't working

Comments

@elcrostatina
Copy link

elcrostatina commented May 28, 2020

Bug

the preventDefault method of the tabPress event doesn't work correctly, the focus remains on the tab that is pressed

Steps To Reproduce

  1. add the tabPress listener with the navigate method to the Tab.Screen
  2. Run the App
  3. Click to the relative tab
  4. Press back icon to return to the previous screen

Describe what you expected to happen:
the focus have to remain on the previous tab

Reproducible sample code

<Tab.Screen name="Share" component={YourScreen} listeners={({navigation}) => ({ tabPress: event => { event.preventDefault(); navigation.navigate('YourScreen); }, })} />

t_video5947238981388207483

@elcrostatina elcrostatina added the bug Something isn't working label May 28, 2020
@gorhom gorhom self-assigned this Jun 2, 2020
@gorhom
Copy link
Owner

gorhom commented Jun 2, 2020

@elcrostatina thanks for reporting this issue, will look into it 👍

@Segfaultd
Copy link

@gorhom Thanks for looking at this! Definitely need that feature 🙏 😄

@ThibaultJRD
Copy link

Any idea when the feature will be released? 😬
Thanks a lot 🙏🏼

@gorhom
Copy link
Owner

gorhom commented Jun 17, 2020

hi guys, sorry i am busy these days, but i got this fixed with this PR (#50)

please test it out and let me know 👍

yarn add ssh://[email protected]:gorhom/react-native-animated-tabbar#feature/allow-parent-to-control-internal-index

@gorhom
Copy link
Owner

gorhom commented Jun 19, 2020

hi @elcrostatina , @ThibaultJRD , @Tyldar would mind test (#50) :)

yarn add ssh://[email protected]:gorhom/react-native-animated-tabbar#feature/allow-parent-to-control-internal-index

@elcrostatina
Copy link
Author

hi @elcrostatina , @ThibaultJRD , @Tyldar would mind test (#50) :)

yarn add ssh://[email protected]:gorhom/react-native-animated-tabbar#feature/allow-parent-to-control-internal-index

it works perfectly 💪💪

@gorhom
Copy link
Owner

gorhom commented Jun 20, 2020

this should be solved with 1.6.0

@Segfaultd
Copy link

Awesome thanks! It works perfectly :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants