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

fix: return when user navigates to the same page #760

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

okwasniewski
Copy link
Member

@okwasniewski okwasniewski commented Aug 28, 2023

Summary

Sometimes when navigating between pages (using TabBar) view state was getting out of sync, to be specific the view.animating was being set to true when it wasn't animating. This was happening when user was pressing multiple times on the same item.

Therefore, this check was met:

if (!animated || !view.animating) {
    [view goTo:index.integerValue animated:animated];
}

Which caused pager view to be stuck on the same page. This check prevents this from happening. Reported here: react-navigation/react-navigation#10425

Test Plan

Go to TabView example and click on the same tab bar item multiple times. Check that it stops on the early return.

Compatibility

OS Implemented
iOS
Android

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I updated the typed files (TS and Flow)

@troZee troZee merged commit 28973cc into master Aug 29, 2023
3 checks passed
@troZee troZee deleted the fix/okwasniewski/goToPage branch August 29, 2023 09:16
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

Successfully merging this pull request may close these issues.

2 participants