Repository navigation
Open
Labels
Description
### Bug Report
When using Top Tabs with swipeEnabled: false, the very first tab is still swipeable on first mount. After swiping once, the swipe is locked as expected.
Code Snippet
<TopTab.Navigator
screenOptions={({ route }) => ({
swipeEnabled: false,
})}
>
{/* screens */}
</TopTab.Navigator>
Expected Behavior
All top tabs should be non-swipeable when swipeEnabled: false is set.
Actual Behavior
On first mount:
The very first top tab is still swipeable.
After the first swipe, it correctly locks and behaves as expected.
Package Versions
{
"name": "My_App",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@react-native-community/blur": "^4.4.1",
"@react-native-community/checkbox": "^0.5.20",
"@react-native-community/netinfo": "^11.4.1",
"@react-native-picker/picker": "^2.11.1",
"@react-native-vector-icons/ant-design": "^12.3.0",
"@react-native-vector-icons/common": "^12.3.0",
"@react-native-vector-icons/entypo": "^12.3.0",
"@react-native-vector-icons/fontawesome6": "^12.2.0",
"@react-native-vector-icons/ionicons": "^12.3.0",
"@react-native-vector-icons/material-design-icons": "^12.3.0",
"@react-native/new-app-screen": "0.80.2",
"@react-navigation/bottom-tabs": "^7.4.6",
"@react-navigation/drawer": "^7.5.7",
"@react-navigation/elements": "^2.6.3",
"@react-navigation/material-top-tabs": "^7.3.6",
"@react-navigation/native": "^7.1.17",
"@react-navigation/native-stack": "^7.3.25",
"@react-navigation/stack": "^7.4.8",
"@realm/react": "^0.11.0",
"@reduxjs/toolkit": "^2.8.2",
"@types/react-native-table-component": "^1.2.8",
"@types/react-native-vector-icons": "^6.4.18",
"axios": "^1.11.0",
"date-fns": "^4.1.0",
"react": "19.1.0",
"react-native": "0.80.2",
"react-native-awesome-slider": "^2.9.0",
"react-native-device-info": "^14.0.4",
"react-native-dotenv": "^3.4.11",
"react-native-element-dropdown": "^2.12.4",
"react-native-full-responsive": "^2.4.5",
"react-native-gesture-handler": "^2.28.0",
"react-native-pager-view": "^6.9.1",
"react-native-paper": "^5.14.5",
"react-native-paper-dates": "^0.22.49",
"react-native-radio-buttons-group": "^3.1.0",
"react-native-reanimated": "^4.1.0",
"react-native-safe-area-context": "^5.6.0",
"react-native-screens": "^4.13.1",
"react-native-table-component": "^1.2.2",
"react-native-uuid": "^2.0.3",
"react-native-webview": "^13.15.0",
"react-native-worklets": "^0.5.1",
"react-redux": "^9.2.0",
"realm": "^12.14.2",
"redux": "^5.0.1",
"redux-devtools-extension": "^2.13.9",
"uuid": "^11.1.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "19.1.1",
"@react-native-community/cli-platform-android": "19.1.1",
"@react-native-community/cli-platform-ios": "19.1.1",
"@react-native/babel-preset": "0.80.2",
"@react-native/eslint-config": "0.80.2",
"@react-native/metro-config": "0.80.2",
"@react-native/typescript-config": "0.80.2",
"@types/jest": "^29.5.13",
"@types/react": "^19.1.0",
"@types/react-test-renderer": "^19.1.0",
"babel-plugin-module-resolver": "^5.0.2",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-native-worklets": "^0.5.1",
"react-test-renderer": "19.1.0",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
}
Full package.json attached above in case needed.
Environment
Node: >=18
Check the Issues already given
@tobycox @sophiebits @cpojer @bvaughn
https://github.com/react-navigation/react-navigation/issues/12668#issue-3193343632
Reacted by Joseph Kreiser, Joar Karlsson, LuanNguyen-HnL, Mutovkin Yurii, clementnv, Stefano Capitanio, Alexandre Lepretre, Mattia Sanfilippo, Thomas Delobel and Lars Danau
Activity
denysoleksiienko commentedon Sep 30, 2025
+1
react-navigation/react-navigation#12668
Philboisvert commentedon Oct 3, 2025
+1
alextbogdanov commentedon Oct 9, 2025
+1
doyoonkim12345 commentedon Oct 12, 2025
+1
danish5454 commentedon Oct 16, 2025
+1
marco242424 commentedon Oct 19, 2025
+1
rgcjhn commentedon Oct 22, 2025
+1
neodin2015 commentedon Oct 22, 2025
I managed to temporarily fix this issue with the following approach:
LarsDanau commentedon Oct 27, 2025
+1
aminhdev commentedon Nov 5, 2025
+1 issue
aminhdev commentedon Nov 5, 2025
Your workaround is working!
Daniel3711997 commentedon Nov 28, 2025
Still exists in 7.0
preis-lab commentedon Dec 2, 2025
As mentioned by @Daniel3711997 , this was supposed to be fixed in 7.0.1, but it's still broken when scrollEnabled={false}. The first render looks fine, but it breaks again afterward.
Here’s a proposed PR to fix it: #1043
troZee commentedon Dec 3, 2025
Fixed in https://github.com/callstack/react-native-pager-view/releases/tag/v7.0.2
Daniel3711997 commentedon Dec 3, 2025
@troZee the NPM release action has failed.
troZee commentedon Dec 3, 2025
Thank you for letting me know. Now it should be fine https://www.npmjs.com/package/react-native-pager-view/v/7.0.2
zewillze commentedon Sep 7, 2026
using v9.0.4 the issue still exist(iOS 15 only) , even hard code collectionview.isScrollEnabled to false but not work. please help
troZee commentedon Sep 7, 2026
@zewillze, please provide a reproduction 🙏 I am not able to reproduce that
zewillze commentedon Sep 7, 2026
hi @troZee , thanks for your reply. Since you couldn’t reproduce the issue, I have created a forked version with my modifications. https://github.com/zewillze/react-native-pager-view-ios15-issue/tree/main
Note: This issue only occurs on iOS 15. I can consistently reproduce it on test devices running iOS 15.1 and 15.2.
You should be able to observe the bug after that. Could you please help debug this issue based on this fork? Thank you very much!
[-]swipeEnabled: false is not working[/-][+][iOS 15] swipeEnabled: false is not working[/+]zewillze commentedon Sep 21, 2026
Thanks @troZee — here is a reproduction plus the root cause. It only happens on iOS 15, which is likely why it isn't reproducible on a newer simulator.
Root cause
On iOS 15 SwiftUI implements
.tabViewStyle(.page)with a compositional layout that pages orthogonally: the horizontal paging is performed by an embeddedUIScrollViewsubview of the collection view (_UICollectionViewOrthogonalScrollerEmbeddedScrollView), while the collection view itself only scrolls vertically.ios/PagerView.swiftappliesisScrollEnabled/bouncesonly to the collection view thatSwiftUIIntrospecthands us, so on iOS 15 the outer view is disabled correctly while the embedded paging scroll view keeps scrolling. Measured with lldb on an iOS 15.2 simulator withscrollEnabled={false}:isScrollEnabledpanGestureRecognizer.isEnabledcontentSize.widthPagingCollectionView(UICollectionView)0✅0_UICollectionViewOrthogonalScrollerEmbeddedScrollView1❌1❌PagerViewProvider.scrollEnabledis also0, i.e. the prop does arrive in the native view — the value just never reaches the view that actually handles the swipe. That is why hard-codingcollectionView.isScrollEnabled = falsedoesn't help either.For comparison, on iOS 18.5 the same probe shows no embedded scroll view at all and
PagingCollectionView.contentSize.width = 804(= 2 pages): there the collection view itself is the pager, so disabling it is enough. Hence the bug is iOS 15-only.Worth noting: #1071 fixed a different failure mode (the initial-value timing, the
.onAppearblock). With 9.0.4 the outer collection view is alreadyisScrollEnabled = 0, so the remaining iOS 15 report is exactly this embedded scroll view.Fix
PR:
<PR_LINK>It forwards
scrollEnabled/overdragto the embedded paging scroll views as well. The traversal stops atUICollectionViewCellboundaries, so scroll views that belong to the pages' React Native content (FlatList/ScrollViewinside a page) are never touched.Verified on iOS 15.2 with lldb, same probe as above:
scrollEnabled={false}→ outer0 / 0, inner0 / 0(no swipe possible)scrollEnabled={true}at runtime → both1 / 1(no regression)setPage:still works while scrolling is disabled (contentOffset.xmoves to the next page)ScrollViewinside a page keeps scrollingIf you want to check it yourself without gestures: attach lldb, find
_UICollectionViewOrthogonalScrollerEmbeddedScrollView(e.g. viarecursiveDescription) and readBefore the fix:
1/1. After:0/0. AUIScrollViewwithisScrollEnabled = NOalso has its pan gesture disabled, so no swipe can scroll it.fix(ios): respect scrollEnabled and overdrag on iOS 15
fix(ios): respect scrollEnabled and overdrag on iOS 15 (#1148)