callstack / react-native-pager-view

React Native wrapper for the Android ViewPager and iOS UIPageViewController.
MIT License
2.7k stars 415 forks source link

Swiping left to right does not work on iOS #686

Open Puneet1796 opened 1 year ago

Puneet1796 commented 1 year ago
export default function MyViewPager({ pagerItems }) {
  return (
    <View style={{ flex: 1 }}>
      <PagerView style={{ flex: 1 }} initialPage={0}>
        {pagerItems.map((item, index) => (
          <View style={{ justifyContent: 'center', alignItems: 'center'  }} key={index + 1 + ""}>
            <Image source={{ uri: item }} style={{ width: 400, height: 400 }} />
          </View>
        ))}
      </PagerView>
    </View>
  );
}

I've used the above component to render the PagerView and it rendered on both platforms but navigating to the next page by swiping left worked on Android but not on iOS. I'm using the expo to create the project. Ref npx create-expo-app <Project name>

andreialecu commented 1 year ago

I noticed the same issue on v6, there used to be a workaround that worked on v5 that no longer seems to work reliably on v6. It relied on using left hitSlop with a negative amount of pixels. More details here https://github.com/PedroBern/react-native-collapsible-tab-view/issues/248

I would assume this would fix it properly: https://github.com/callstack/react-native-pager-view/pull/665

okwasniewski commented 1 year ago

Hey @Puneet1796, this should work properly on the latest version, can you re-test?

james-ovens-eurostar commented 3 months ago

Might be caused by this: https://github.com/callstack/react-native-pager-view/pull/705 Which would be reverted by this: https://github.com/callstack/react-native-pager-view/pull/771