scrollEnabled={false} not respected on iOS (Fabric / New Architecture)
Environment
- Library version: 6.9.1
- React Native: 0.81.x
- Architecture: New Architecture (Fabric) enabled
- Platform: iOS
- Expo: 54
Description
When scrollEnabled is set to false on PagerView, horizontal swiping is still possible on iOS. The same setup works correctly on Android—swiping does nothing when scrollEnabled is false.
This occurs with the New Architecture (Fabric) enabled. The scrollEnabled prop appears to be applied in updateProps in RNCPagerViewComponentView.mm, but there may be a timing or initialization issue where:
- The scroll view is created in
willMoveToSuperview / initializeNativePageViewController
updateProps may run before the scroll view exists, or the initial scrollEnabled value is never applied at setup time
- The scroll view defaults to
scrollEnabled = YES and never receives the false value
Expected behavior
Setting scrollEnabled={false} should prevent horizontal page swiping, matching Android behavior.
Actual behavior
On iOS, the pager still responds to horizontal swipe gestures and changes pages even when scrollEnabled is false.
Workaround
Using react-native-gesture-handler with Gesture.Native() and a Gesture.Pan().blocksExternalGesture(native) to block swipes when scroll should be disabled. This is a reasonable workaround but requires extra dependencies and code.
Related
- #971 – Accessibility/VoiceOver case where scroll disabled pager still scrolls
scrollEnabled={false}not respected on iOS (Fabric / New Architecture)Environment
Description
When
scrollEnabledis set tofalseonPagerView, horizontal swiping is still possible on iOS. The same setup works correctly on Android—swiping does nothing whenscrollEnabledis false.This occurs with the New Architecture (Fabric) enabled. The
scrollEnabledprop appears to be applied inupdatePropsinRNCPagerViewComponentView.mm, but there may be a timing or initialization issue where:willMoveToSuperview/initializeNativePageViewControllerupdatePropsmay run before the scroll view exists, or the initialscrollEnabledvalue is never applied at setup timescrollEnabled = YESand never receives thefalsevalueExpected behavior
Setting
scrollEnabled={false}should prevent horizontal page swiping, matching Android behavior.Actual behavior
On iOS, the pager still responds to horizontal swipe gestures and changes pages even when
scrollEnabledisfalse.Workaround
Using
react-native-gesture-handlerwithGesture.Native()and aGesture.Pan().blocksExternalGesture(native)to block swipes when scroll should be disabled. This is a reasonable workaround but requires extra dependencies and code.Related