From 482c73de8615d8e88c3773cfb01f38f3fb43d660 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Wed, 4 Jan 2017 14:40:32 -0800 Subject: [PATCH] More accurate touch bookkeeping in RCTTouchHandler Reviewed By: javache Differential Revision: D4381374 fbshipit-source-id: d959381617eda93658d519e7a3c565093eb9fae8 --- React/Base/RCTTouchHandler.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/React/Base/RCTTouchHandler.m b/React/Base/RCTTouchHandler.m index a5cea9c51..1c36073f8 100644 --- a/React/Base/RCTTouchHandler.m +++ b/React/Base/RCTTouchHandler.m @@ -92,7 +92,7 @@ typedef NS_ENUM(NSInteger, RCTTouchEventType) { NSNumber *reactTag = [targetView reactTagAtPoint:[touch locationInView:targetView]]; if (!reactTag || !targetView.userInteractionEnabled) { - return; + continue; } // Get new, unique touch identifier for the react touch @@ -125,7 +125,7 @@ typedef NS_ENUM(NSInteger, RCTTouchEventType) { { for (UITouch *touch in touches) { NSUInteger index = [_nativeTouches indexOfObject:touch]; - if(index == NSNotFound) { + if (index == NSNotFound) { continue; } @@ -322,6 +322,10 @@ static BOOL RCTAnyTouchesChanged(NSSet *touches) - (void)reset { _dispatchedInitialTouches = NO; + + [_nativeTouches removeAllObjects]; + [_reactTouches removeAllObjects]; + [_touchViews removeAllObjects]; } - (void)cancel