-
Notifications
You must be signed in to change notification settings - Fork 462
Description
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 updatePropsmay run before the scroll view exists, or the initialscrollEnabledvalue is never applied at setup time- The scroll view defaults to
scrollEnabled = YESand never receives thefalsevalue
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