callstack / react-native-pager-view

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

Android - Switching from portrait to landscape causes tab content to be stuck between two tabs #744

Open MightyWarpot opened 1 year ago

MightyWarpot commented 1 year ago

Environment

package version
react-native-pager-view 6.2.0
react-native 0.71.8
node 14.21.1
npm or yarn 6.14.17

Android 13 (API 33)

Description

After swiping to a tab (that is not the first tab) in portrait mode, and then swiping to the previous tab and rotating the device into landscape, the content of the tab is stuck between the current tab and the previous tab. Reproducible on Android 12 and 13. Not an issue on iOS.

Expected behavior

The tab content renders only the current tab content/component and does not show any content from adjacent tabs.

Reproducible Demo

https://github.com/callstack/react-native-pager-view/assets/83900794/fdecc3f7-83b3-4e93-b470-e74c5b96a97d

I used the BasicPagerViewExample in the example folder of react-native-pager-view. The video shows how you can reproduce it. I've described the steps to reproduce in the description.

chandresh8187 commented 7 months ago

same issue