Fix stack with gestureEnabled=false on iOS (#283)

#254 without breaking changes

Instead of moving gestureEnabled to the screen we find the header config subview.
This commit is contained in:
Janic Duplessis
2020-01-14 15:46:16 -05:00
committed by Michał Osadnik
parent ce819f6356
commit 27ef6dc900
2 changed files with 10 additions and 2 deletions

View File

@@ -102,7 +102,16 @@
RCTRootContentView *rootView = (RCTRootContentView *)parent;
[rootView.touchHandler cancel];
return _controller.viewControllers.count > 1;
UIView *topView = _controller.viewControllers.lastObject.view;
RNSScreenStackHeaderConfig *config = nil;
for (UIView *subview in topView.reactSubviews) {
if ([subview isKindOfClass:[RNSScreenStackHeaderConfig class]]) {
config = (RNSScreenStackHeaderConfig*) subview;
break;
}
}
return _controller.viewControllers.count > 1 && (config == nil || config.gestureEnabled);
}
- (void)markChildUpdated

View File

@@ -267,7 +267,6 @@
}
[navctr setNavigationBarHidden:shouldHide animated:YES];
navctr.interactivePopGestureRecognizer.enabled = config.gestureEnabled;
#ifdef __IPHONE_13_0
if (@available(iOS 13.0, *)) {
vc.modalInPresentation = !config.gestureEnabled;