PedroBern / react-native-collapsible-tab-view

A cross-platform Collapsible Tab View component for React Native
MIT License
830 stars 161 forks source link

Header not moving after pressing tabs or swiping on RTL layout #181

Open hossein-zare opened 3 years ago

hossein-zare commented 3 years ago

Current behavior

Everything is fine when i scroll up & down, The header is collapsible until i press tabs or swipe, The header doesn't move anymore.

My app is RTL for your information.

Expected behaviour

The header should always be collapsible.

Code sample

const HEIGHT = 250;

const Header = useCallback(() => (
  <View style={{
    backgroundColor: "red",
    width: "100%",
    height: HEIGHT
  }} />
), []);

<Tabs.Container
  renderHeader={Header}
  headerHeight={HEIGHT}>
    <Tabs.Tab name="A">
      <Tabs.ScrollView>
        <View style={[styles.box, styles.boxA]} />
        <View style={[styles.box, styles.boxB]} />
        <View style={[styles.box, styles.boxA]} />
        <View style={[styles.box, styles.boxB]} />
      </Tabs.ScrollView>
    </Tabs.Tab>

    <Tabs.Tab name="B">
      <Tabs.ScrollView>
        <View style={[styles.box, styles.boxA]} />
        <View style={[styles.box, styles.boxB]} />
        <View style={[styles.box, styles.boxA]} />
        <View style={[styles.box, styles.boxB]} />
      </Tabs.ScrollView>
    </Tabs.Tab>
</Tabs.Container>

Screenshots (if applicable)

Untitled

package.json

"react-native": "0.64.1",
"react-native-collapsible-tab-view": "4.2.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-reanimated": "2.0.0",
andreialecu commented 3 years ago

If you switch to LTR does it work properly?

hossein-zare commented 3 years ago

@andreialecu Yes

saurabh874 commented 3 years ago

@hossein-zare are you able to indication blue strip when change the tab in RTL? if yes do you pass any other props?

hossein-zare commented 3 years ago

@saurabh874 No, it doesn't show the blue stripe at first. I think you need to create your own Tab Bar.