Skip to content

Commit d6ccbad

Browse files
authored
fix(ios): fix freezing when navigating to same index (#804)
1 parent 384d261 commit d6ccbad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ios/RNCPagerView.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ - (void)enableSwipe {
126126
}
127127

128128
- (void)goTo:(NSInteger)index animated:(BOOL)animated {
129+
if ([self getCurrentPage] == index) {
130+
return;
131+
}
132+
129133
CGPoint targetOffset = [self isHorizontal] ? CGPointMake(_scrollView.frame.size.width * index, 0) : CGPointMake(0, _scrollView.frame.size.height * index);
130134

131135
if (animated) {

0 commit comments

Comments
 (0)