Skip to content

Commit dfa4536

Browse files
authored
fix(ios): Prevent removal of one or many pages at a time (#467)
1 parent 2566192 commit dfa4536

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ios/ReactNativePageView.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ - (void)goTo:(NSInteger)index animated:(BOOL)animated {
256256

257257
if (!isForward && diff > 0) {
258258
for (NSInteger i=_currentIndex; i>=index; i--) {
259-
if (index == _currentIndex || i == numberOfPages) {
259+
// Prevent removal of one or many pages at a time
260+
if (index == _currentIndex || i >= numberOfPages) {
260261
continue;
261262
}
262263
[self goToViewController:i direction:direction animated:animated shouldCallOnPageSelected: i == index];

0 commit comments

Comments
 (0)