question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
RMG0commented, Jan 11, 2022

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

3reactions
LeviWilliamscommented, Feb 18, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

detachinactivescreens | The AI Search Engine You Control
callstack/react-native-pager-viewonPageSelected called automatically when navigate to other screen and detachInactiveScreens is false#488.
Read more >
onPageSelected called instatly on viewPager.setCurrentItem
My problem is that it seems like the onPageSelected(int position) is called before the animation is complete. Here's the code :) Where i...
Read more >
ViewPager OnPageChangeListener is not called for initial ...
In the onResume() method of that activity, I check for an intent parameter specifying which page to display and call pager.setCurrentItem(n, false) to ......
Read more >
react-native-pager-view - bytemeta
onPageSelected called automatically when navigate to other screen and detachInactiveScreens is false. matheusmatos. matheusmatos OPEN · Updated 8 months ago ...
Read more >
Support for Terraform Cloud Agents - Hashicorp/Consul-Terraform ...
onPageSelected called automatically when navigate to other screen and detachInactiveScreens is false, 6, 2021-12-07, 2022-12-05.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found