File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -184,10 +184,17 @@ - (void)setReactViewControllers:(NSInteger)index
184
184
if (animated == YES ) {
185
185
self.animating = YES ;
186
186
}
187
+
188
+ //
189
+ // If 'controller' is the current visible controller and the 'animated' flag is set to YES,
190
+ // then 'setViewControllers' is called without invoking the completion handler. This can block the navigation from working.
191
+ // So we need to check if that would be the case, and if so, we will not perform animation.
192
+ //
193
+ BOOL canAnimate = (controller != [[self .reactPageViewController viewControllers ] firstObject ] );
187
194
188
195
[self .reactPageViewController setViewControllers: @[controller]
189
196
direction: direction
190
- animated: animated
197
+ animated: canAnimate? animated: NO
191
198
completion: ^(BOOL finished) {
192
199
__strong typeof (self) strongSelf = weakSelf;
193
200
strongSelf.currentIndex = index;
You can’t perform that action at this time.
0 commit comments