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

onPageSelected called automatically when navigate to other screen and detachInactiveScreens is false

Open crzycoder opened this issue 3 years ago • 6 comments

Environment

"react": "17.0.2", "react-native": "0.66.2" "react-native-pager-view": "^6.0.0-rc.0" "@react-navigation/native": "^6.0.6"

Description

disable the detachInactiveScreens and navigate to other screen and after came back the page is set to zero onPageSelected event is called every time when I navigate to other screen. Event is working fine when detachInactiveScreens is true.

crzycoder avatar Dec 07 '21 07:12 crzycoder

Hi, even detachInactiveScreens is not fixing for me. From my testing, it looks like, starting from react-native 0.65.0, onPageSelected(0) is fired(Android only) when you navigate to child stack screen OR coming back from child stack screen

RMG0 avatar Jan 11 '22 19:01 RMG0

This is still happening with us in production and is a huge issue, does anyone have any idea how to fix? Only starting in > 0.65

LeviWilliams avatar Feb 18 '22 16:02 LeviWilliams

I am also facing this problem and downgraded our react-native version to <0.65

dcphi avatar Mar 28 '22 13:03 dcphi

@dcphi I think there are some combinations causing this issue. Because in my case I just did animationEnabled: Platform.OS === 'ios' ? false : true for Stack.Navigator screenOptions. Just sharing incase if this fixes your case

RMG0 avatar Mar 28 '22 20:03 RMG0

@RMG0 Thanks for the insight. Unfortunately, this didn't fix the problem for us

dcphi avatar Apr 01 '22 15:04 dcphi

I have same problem ; @dcphi did you find a solution ? :/

GaylordP avatar Aug 04 '22 22:08 GaylordP