From 44bf85a041084cd3031c4d30b1dea18bbe8f53e2 Mon Sep 17 00:00:00 2001 From: Martin Kralik Date: Thu, 12 May 2016 08:10:50 -0700 Subject: [PATCH] different coalescing key for `touchCancel` events Summary: On iPad we may get two touch cancel events in direct succession. They would have the same coalescing key, which would result in unsuccesful attempt to coalesce them. This diff fixes it by making sure two cancel events cannot have the same coalescing key. (An alternative fix would be implementing coalescing logic for cancel events, but that sounds more complicated. It would be neccessary if there is a legit scenario where big number of cancel events are emitted in succesion.) Reviewed By: javache Differential Revision: D3292405 fbshipit-source-id: 1f269771dc81fdd637cf6ac3ee4725e5e2fec679 --- React/Base/RCTTouchHandler.m | 1 + 1 file changed, 1 insertion(+) diff --git a/React/Base/RCTTouchHandler.m b/React/Base/RCTTouchHandler.m index f164022e797..e1025016c2d 100644 --- a/React/Base/RCTTouchHandler.m +++ b/React/Base/RCTTouchHandler.m @@ -295,6 +295,7 @@ static BOOL RCTAnyTouchesChanged(NSSet *touches) { [super touchesCancelled:touches withEvent:event]; + _coalescingKey++; if (_dispatchedInitialTouches) { [self _updateAndDispatchTouches:touches eventName:@"touchCancel" originatingTime:event.timestamp];