From 78b167c735695768c07f7054738e8aada72cd99f Mon Sep 17 00:00:00 2001 From: ericlewis Date: Mon, 25 Feb 2019 14:28:16 -0800 Subject: [PATCH] Call super if shouldDisableScrollInteraction false (#23647) Summary: Allow iOS to handle `touchesShouldCancelInContentView` on RCTScrollView if we aren't disabling the scroll interaction. [iOS] [Changed] - RCTScrollView allows iOS to handle touchesShouldCancelInContentView Pull Request resolved: https://github.com/facebook/react-native/pull/23647 Differential Revision: D14214248 Pulled By: hramos fbshipit-source-id: 6e1bab3085aed6cabb93fb5dc988afe3911817e8 --- React/Views/ScrollView/RCTScrollView.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/React/Views/ScrollView/RCTScrollView.m b/React/Views/ScrollView/RCTScrollView.m index 2ed87866b..75da9bb08 100644 --- a/React/Views/ScrollView/RCTScrollView.m +++ b/React/Views/ScrollView/RCTScrollView.m @@ -280,8 +280,13 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) */ - (BOOL)touchesShouldCancelInContentView:(__unused UIView *)view { - //TODO: shouldn't this call super if _shouldDisableScrollInteraction returns NO? - return ![self _shouldDisableScrollInteraction]; + BOOL shouldDisableScrollInteraction = [self _shouldDisableScrollInteraction]; + + if (shouldDisableScrollInteraction == NO) { + [super touchesShouldCancelInContentView:view]; + } + + return !shouldDisableScrollInteraction; } /*