Closed francoangulo closed 10 months ago
I experience the same behaviour with expo 49, RNGH 2.12.0, pager view 6.2.0.
Just found I used name
property instead of label
one, and so the scrolls were struggling. I change name
for label
and add "A", "B", "C" for my tabs names.
Just found I used
name
property instead oflabel
one, and so the scrolls were struggling. I changename
forlabel
and add "A", "B", "C" for my tabs names.
Hi @tiste, could you provide me more details on how you solved this? Like your code before and after solving it? Please I am still fighting with it
I switch from something like
<Tabs.Container
minHeaderHeight={MIN_HEADER_HEIGHT}
headerContainerStyle={{
backgroundColor: theme.colors.backgroundSecondary,
shadowOpacity: 0,
}}
renderHeader={() => (
<View style={{ marginBottom: spacing.extraSmall }}></View>
)}
>
<Tabs.Tab name={translate("proScreen.tabs.common")}>
<Tabs.ScrollView>
<View style={[CONTAINER, PAGE_STYLE]}>
<Text>{pro.humanOpeningHours}</Text>
</View>
</Tabs.ScrollView>
</Tabs.Tab>
<Tabs.Tab name={translate("proScreen.tabs.otherFeatures")}>
<Tabs.ScrollView>
<View style={[CONTAINER, PAGE_STYLE]}></View>
</Tabs.ScrollView>
</Tabs.Tab>
</Tabs.Container>
to
<Tabs.Container
minHeaderHeight={MIN_HEADER_HEIGHT}
headerContainerStyle={{
backgroundColor: theme.colors.backgroundSecondary,
shadowOpacity: 0,
}}
renderHeader={() => (
<View style={{ marginBottom: spacing.extraSmall }}></View>
)}
>
<Tabs.Tab name="A" label={translate("proScreen.tabs.common")}>
<Tabs.ScrollView>
<View style={[CONTAINER, PAGE_STYLE]}>
<Text>{pro.humanOpeningHours}</Text>
</View>
</Tabs.ScrollView>
</Tabs.Tab>
<Tabs.Tab name="B" label={translate("proScreen.tabs.otherFeatures")}>
<Tabs.ScrollView>
<View style={[CONTAINER, PAGE_STYLE]}></View>
</Tabs.ScrollView>
</Tabs.Tab>
</Tabs.Container>
I was using name
as my label.
@tiste thanks for providing this! However, I can't discover the issue, but I'm pretty sure it's related to the Tabs.ScrollView since the behavior disappears when I remove it, but I can't scroll and collapse the header anymore
I guess the right behavior should be that the 3 tabs scroll together at the same time and thus when you switch to another tab they are at the same point, or, the header should resize automatically right after switching tabs and before the user scrolls, not after that
@francoangulo try to remove all the boilerplate you could have around, until it works.
To discover my issue, I copied/pasted the quickstart in place to check if it's due to lib versions, or my code. Since it was working, I added back little by little my own code until I discovered the name
/label
fail I did.
That was a great suggestion, but I still experience the behavior with the quickstart example
@francoangulo hm... be sure to npm/yarn install
correctly the last versions of each lib, maybe remove lockfiles and restart expo/react-native.
@tiste that was it! the fix was to upgrade the version of reanimated! (v2.2.0 -> 3.4.2) I've been struggling with this for 2 weeks, thanks a lot hero you saved me!
Idk if this is a bug or bad application of the library, but I can't find any response in the library docs or in other issues reported. Does anyone have any idea on how to solve this?
https://github.com/PedroBern/react-native-collapsible-tab-view/assets/58487596/e095ad45-7ddc-43eb-a5f2-f9c43a54cc5b
These are the tabs
And this is the header
using react-native-collapsible-tab-view v6.2.0