react-native-pager-view icon indicating copy to clipboard operation
react-native-pager-view copied to clipboard

Swiping left to right does not work on iOS

Open Puneet1796 opened this issue 2 years ago • 3 comments

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>

Puneet1796 avatar Jan 31 '23 07:01 Puneet1796

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

andreialecu avatar Mar 09 '23 08:03 andreialecu

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

okwasniewski avatar Apr 05 '23 20:04 okwasniewski