Skip to content

Commit 06916bb

Browse files
feat(ios): BREAKING CHANGE - change default value of overDrag prop to false (#364)
* fix(ios): offset is changing while overDrag is disabled * feat: change overDrag to be false by default
1 parent 4669de6 commit 06916bb

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ For advanced usage please take a look into our [example project](https://github.
147147
| `showPageIndicator: boolean` | Shows the dots indicator at the bottom of the view | iOS |
148148
| `overScrollMode: OverScollMode` | Used to override default value of overScroll mode. Can be `auto`, `always` or `never`. Defaults to `auto` | Android |
149149
| `offscreenPageLimit: number` | Set the number of pages that should be retained to either side of the currently visible page(s). Pages beyond this limit will be recreated from the adapter when needed. Defaults to RecyclerView's caching strategy. The given value must either be larger than 0. | Android |
150-
| `overdrag: boolean` | Allows for overscrolling after reaching the end or very beginning or pages | iOS |
150+
| `overdrag: boolean` | Allows for overscrolling after reaching the end or very beginning or pages. Defaults to `false` | iOS |
151151

152152
| Method | Description | Platform |
153153
| ------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------: |
@@ -189,4 +189,4 @@ requestAnimationFrame(() => refPagerView.current?.setPage(index));
189189

190190
## License
191191

192-
MIT
192+
MIT

ios/ReactNativePageView.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher {
4444
_coalescingKey = 0;
4545
_eventDispatcher = eventDispatcher;
4646
_cachedControllers = [NSHashTable weakObjectsHashTable];
47-
_overdrag = YES;
47+
_overdrag = NO;
4848
}
4949
return self;
5050
}
@@ -413,4 +413,4 @@ - (NSString *)determineScrollDirection:(UIScrollView *)scrollView {
413413
}
414414
return scrollDirection;
415415
}
416-
@end
416+
@end

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export interface PagerViewProps {
125125
overScrollMode?: OverScrollMode;
126126
/**
127127
* Determines whether it's possible to overscroll a bit
128-
* after reaching end or very beginning of pages.
128+
* after reaching end or very beginning of pages. The default value is false.
129129
*/
130130
overdrag?: boolean;
131131
}

0 commit comments

Comments
 (0)