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(tabs): fix weird behavior when disabling animations on tabstrip #406

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

edusperoni
Copy link
Contributor

This fixes a weird scenario where when animations are disabled the tabstrip doesn't go to the correct position.

The reason for the complicated solution is that if you're midscroll the scrollstate will bug out on 2 and we'll receive an extra onPageScrolled event, so we just forcefully change the tab and ignore the state until the scroll state changes (this ALWAYS changes when a scroll starts, even when in the bugged 2 state, goes either to 1 or 0);

I've tested with this PR:

  • change tabs dragging (animation disabled and enabled)
  • change tabs tapping on elements (animation disabled and enabled)
  • change tabs programmatically (animation disabled and enabled)
  • change tabs programmatically with animations disabled WHILE dragging

Very ugly, but gets the job done.

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.

1 participant