Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:
branches:
- master


jobs:
ios-build:
runs-on: macos-14
Expand All @@ -39,7 +38,7 @@ jobs:
cache-name: cached-ios-pods-deps
with:
path: example/ios/Pods
key: ${{ hashFiles('./example/ios/Podfile.lock') }}
key: ${{ hashFiles('example/ios/Podfile.lock') }}

- name: Bundle app
run: bun build:ios
Expand Down
Binary file modified example/bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ PODS:
- React-jsiexecutor
- React-RCTFBReactNativeSpec
- ReactCommon/turbomodule/core
- react-native-pager-view (6.8.1):
- react-native-pager-view (7.0.0):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -2321,7 +2321,7 @@ SPEC CHECKSUMS:
React-logger: 8edfcedc100544791cd82692ca5a574240a16219
React-Mapbuffer: c3f4b608e4a59dd2f6a416ef4d47a14400194468
React-microtasksnativemodule: 054f34e9b82f02bd40f09cebd4083828b5b2beb6
react-native-pager-view: 919534782a0489f7e2aeeb9a8b8959edfd3f067a
react-native-pager-view: 39dffe42e6c5d419a16e3b8fe6522e43abcdf7e3
react-native-safe-area-context: 562163222d999b79a51577eda2ea8ad2c32b4d06
React-NativeModulesApple: 2c4377e139522c3d73f5df582e4f051a838ff25e
React-oscompat: ef5df1c734f19b8003e149317d041b8ce1f7d29c
Expand Down
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "17.0.1",
"@react-native-community/cli": "15.0.1",
"@react-native-community/cli-platform-android": "15.0.1",
"@react-native-community/cli-platform-ios": "15.0.1",
"@react-native/babel-preset": "0.79.2",
Expand All @@ -60,4 +60,4 @@
"engines": {
"node": ">=20"
}
}
}
17 changes: 14 additions & 3 deletions ios/RNCPagerViewComponentView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ @implementation RNCPagerViewComponentView {
NSInteger _destinationIndex;
BOOL _overdrag;
NSString *_layoutDirection;
BOOL _scrollEnabled;
}

// Needed because of this: https://github.com/facebook/react-native/pull/37274
Expand Down Expand Up @@ -64,6 +65,8 @@ - (void)initializeNativePageViewController {
scrollView = (UIScrollView *)subview;
}
}

[self applyScrollEnabled];
}

- (instancetype)initWithFrame:(CGRect)frame
Expand All @@ -76,6 +79,7 @@ - (instancetype)initWithFrame:(CGRect)frame
_destinationIndex = -1;
_layoutDirection = @"ltr";
_overdrag = NO;
_scrollEnabled = YES;
Copy link

@johankasperi johankasperi Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When adapting this code to patch version 6.9.1 in our app I had to remove this line to make it work. Don't know if you need to do the same in this PR but just wanted to share my findings and give you a heads up. Thank you for fixing this!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking it out! I'm not sure why it wouldn't work for you.. Without setting this to YES the state will be desynchronized (as the default for a scroll view is to have scroll enabled).

I did some additional tests and it was working well with this.

}

return self;
Expand Down Expand Up @@ -126,6 +130,7 @@ -(void)prepareForRecycle {
[super prepareForRecycle];
_nativePageViewController = nil;
_currentIndex = -1;
_scrollEnabled = YES;
}

- (void)shouldDismissKeyboard:(RNCViewPagerKeyboardDismissMode)dismissKeyboard {
Expand All @@ -143,6 +148,10 @@ - (void)shouldDismissKeyboard:(RNCViewPagerKeyboardDismissMode)dismissKeyboard {
#endif
}

- (void)applyScrollEnabled {
scrollView.scrollEnabled = _scrollEnabled;
}


- (void)updateProps:(const facebook::react::Props::Shared &)props oldProps:(const facebook::react::Props::Shared &)oldProps{
const auto &oldScreenProps = *std::static_pointer_cast<const RNCViewPagerProps>(_props);
Expand All @@ -165,8 +174,9 @@ - (void)updateProps:(const facebook::react::Props::Shared &)props oldProps:(cons
[self shouldDismissKeyboard: newScreenProps.keyboardDismissMode];
}

if (newScreenProps.scrollEnabled != scrollView.scrollEnabled) {
scrollView.scrollEnabled = newScreenProps.scrollEnabled;
if (oldScreenProps.scrollEnabled != newScreenProps.scrollEnabled) {
_scrollEnabled = newScreenProps.scrollEnabled;
[self applyScrollEnabled];
}

if (newScreenProps.overdrag != _overdrag) {
Expand Down Expand Up @@ -387,7 +397,8 @@ - (void)setPageWithoutAnimation:(NSInteger)index {
}

- (void)setScrollEnabledImperatively:(BOOL)scrollEnabled {
[scrollView setScrollEnabled:scrollEnabled];
_scrollEnabled = scrollEnabled;
[self applyScrollEnabled];
}

#pragma mark - Helpers
Expand Down
Loading