Skip to content

Commit

Permalink
fix(ios): fix freezing when navigating to same index (#804)
Browse files Browse the repository at this point in the history
  • Loading branch information
krozniata authored Mar 29, 2024
1 parent 384d261 commit d6ccbad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ios/RNCPagerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ - (void)enableSwipe {
}

- (void)goTo:(NSInteger)index animated:(BOOL)animated {
if ([self getCurrentPage] == index) {
return;
}

CGPoint targetOffset = [self isHorizontal] ? CGPointMake(_scrollView.frame.size.width * index, 0) : CGPointMake(0, _scrollView.frame.size.height * index);

if (animated) {
Expand Down

0 comments on commit d6ccbad

Please sign in to comment.