callstack / react-native-pager-view

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

[android] when used as material-top-tab with react-navigation, navigation.navigate may not complete screen transition #910

Open lovegaoshi opened 5 days ago

lovegaoshi commented 5 days ago

Environment

package version
@react-navigation/native 7.0.1
@react-navigation/drawer 7.0.1
@react-navigation/material-top-tabs 7.0.1
react-native-pager-view 6.5.0
react-native 0.76.1
expo 20.0.2
node 20
npm or yarn 4

Description

hi! crossposted from https://github.com/react-navigation/react-navigation/issues/12251 I use a custom drawer content to put buttons that navigate to specific screens as material top tabs, which are nested as a drawer screen. since the new arch migration, I observed the sliding transition of the tab screens are 1. too fast; 2. it occasionally does not do a full transition in dev, and almost never in release. this behavior is not observed in the old arch. Many thanks for anyone having a look at this!

see the attached video; error occurs toward the very end https://github.com/user-attachments/assets/42b7e0b4-d784-4ae4-9595-99926aa0126b

Reproducible Demo

My reproducer is adapted from my app, but I trimmed all of my code and left only Bug.tsx as the actual reproducer. https://github.com/lovegaoshi/azusa-player-mobile/tree/bug

infotheme-dev commented 3 days ago

Hi all I found a solution and it's woking like charm look you have to follow one thing here : simply disable newArchEnabled=false in gradle properties, This is a problem with newArch

lovegaoshi commented 2 days ago

thanks, but im actively trying to migrate to newarch as well, since expo "threatened" dropping old arch support in 2025.

On Wed, Nov 13, 2024, 11:52 PM infotheme-dev @.***> wrote:

Hi all I found a solution and it's woking like charm look you have to follow one thing here : simply disable newArchEnabled=false in gradle properties, This is a problem with newArch

— Reply to this email directly, view it on GitHub https://github.com/callstack/react-native-pager-view/issues/910#issuecomment-2475645409, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZMOVVR6C6NYOFOARJT7YLL2ARJDXAVCNFSM6AAAAABRSSWNYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZVGY2DKNBQHE . You are receiving this because you authored the thread.Message ID: @.***>

infotheme-dev commented 2 days ago

Yes this is for those who are developing things right now, So that they can continue with dev. Did you tried to do a workaround using React Native's backHandler to return false;

lovegaoshi commented 2 days ago

pardon me im not aware of how to put that backhandler part; i thought the bug is navigation. navigate into a nested screen, i have no problem sliding or using the back gesture

On Thu, Nov 14, 2024, 3:43 AM infotheme-dev @.***> wrote:

Yes this is for those who are developing things right now, So that they can continue with dev. Did you tried to do a workaround using React Native's backHandler to return false;

— Reply to this email directly, view it on GitHub https://github.com/callstack/react-native-pager-view/issues/910#issuecomment-2476139293, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZMOVVWKMIB4QOG4LJ5STZ32ASEH7AVCNFSM6AAAAABRSSWNYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZWGEZTSMRZGM . You are receiving this because you authored the thread.Message ID: @.***>