From d6ccbad36668fc2b8db40612654a27a194b7737f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Ro=C5=BCniata?= <56474758+krozniata@users.noreply.github.com> Date: Fri, 29 Mar 2024 10:05:45 +0100 Subject: [PATCH] fix(ios): fix freezing when navigating to same index (#804) --- ios/RNCPagerView.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ios/RNCPagerView.m b/ios/RNCPagerView.m index 27103213..709a12ba 100644 --- a/ios/RNCPagerView.m +++ b/ios/RNCPagerView.m @@ -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) {