-
Notifications
You must be signed in to change notification settings - Fork 187
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
Force a tab to start at a certain scroll position #98
Labels
question
Further information is requested
Comments
@andreialecu Hey, nice to know, while trying to debug it I noticed that this only occurs if snap is enabled. After some more debugging I believe that the root cause is .scrollTo who doesn't trigger the onMomentumEnd(facebook/react-native#21718) handler which is where the snappingTo.value is updated |
PedroBern
added a commit
that referenced
this issue
Feb 9, 2021
Version 4.0 with api refactoring and dynamic tabs. BREAKING CHANGES: createCollapsibleTabs() no longer exists. Instead the library exports different components (Container, Tab, ScrollView, ListView) which can be nested like normal react components. refMap no longer exists, and creating refs is no longer necessary (it's all handled internally) ScrollView/FlatList now forward their refs, so the caller can just tap into their ref prop the existing onIndexChange was renamed to onTabChange, and a separate onIndexChange was implemented that just returns the new index (as a number) diffClampEnabled was changed to revealHeaderOnScroll redundant prop snapEnabled was removed, instead snapThreshold is number | null | undefined. If not a number, then snap is not enabled. Setting it to 0.5 will result in snapping in the middle, like in the previous version. Fixes: #100, #98, #94, #88
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey(once again), I was trying to force a tab to always start at a certain scroll position, this is a really specific behavior, what I tried to do was on the indexChange call the scrollTo on that tab to place it on the position where I need, example
This works great for the current tab but the others tab don't sync their position properly, should I call another function or just update some value from the context? Thanks once again
The text was updated successfully, but these errors were encountered: