Closed alexpchin closed 3 years ago
Hi @alexpchin thanks, I hope you had a nice time too :)
If you log the isGlidding
, does it update from false
to true
and vice versa?
@PedroBern When first loading, without scrolling isGliding
is false
. Then when I scroll up and wait for the tabBar to reach the top, isGliding
is false
. However, if I click during the scroll, isGliding
is true
and then it doesn't switch back and it seemingly gets stuck.
What if we do:
customRenderTabBar({
...props,
...tabBarProps,
isGliding,
preventTabPressOnGliding
})
Why do we pass the .current
reference instead of the whole ref? Am I forgetting something?
If we pass the whole ref, then we will need to use the .current
inside the custom tab bar. But if this fixes, ok then. I didn't test with a custom tab bar yet.
Can you test and send a PR? If you can't, I probably will see it only later this week
@PedroBern I'll take a look now
Hi @PedroBern I've made a PR https://github.com/PedroBern/react-native-collapsible-tab-view/pull/34 Please take a look!
@alexpchin thanks for the PR, v2 is out 🚀
@alexpchin I did some modifications to the example after updating the types 👍
@PedroBern Thanks for merging so quiickly. My Typescript is a bit rusty... I thought you might have to do that!
the problem was with the CollapsibleTabView
types definition, now its good, but I still need to add the generics for the createMaterialCollapsibleTabView
Now it's possible to pass the custom tab bar props type into the CollapsibleTabView and tabBarProps and renderTabBar will recognize the props
<CollapsibleTabView<Route, CustomTabBarProps> ... tabBarProps={{... typedProps ...}} ... />
Hi @PedroBern I hope you had a nice Christmas and New Year.
I'm just looking into an issue when you use a custom tab bar. Everything works when you don't render a custom tab bar, however, when using a custom tab bar it seems like the preventDefault does not prevent clicking on the tab when the user is scrolling. Is this perhaps because the
isGliding.current
is being passed instead ofisGliding
?Basically it becomes gittery.
The code below:
Within my custom TabBar, I'm using (shortened version):
This is a video showing it working with no custom tab bar:
This is a video showing it not working with a custom tab bar: