Skip to content

Commit b1b53aa

Browse files
majakFacebook Github Bot 8
authored andcommitted
coalescingKeys for RCTTouchEvent
Reviewed By: javache Differential Revision: D3092864 fb-gh-sync-id: b703dca92578e05195eac9171b5b6eee83976cc9 fbshipit-source-id: b703dca92578e05195eac9171b5b6eee83976cc9
1 parent 7c2b397 commit b1b53aa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

React/Base/RCTTouchHandler.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ @implementation RCTTouchHandler
3939
BOOL _dispatchedInitialTouches;
4040
BOOL _recordingInteractionTiming;
4141
CFTimeInterval _mostRecentEnqueueJS;
42+
uint16_t _coalescingKey;
4243
}
4344

4445
- (instancetype)initWithBridge:(RCTBridge *)bridge
@@ -200,7 +201,7 @@ - (void)_updateAndDispatchTouches:(NSSet<UITouch *> *)touches
200201
RCTTouchEvent *event = [[RCTTouchEvent alloc] initWithEventName:eventName
201202
reactTouches:reactTouches
202203
changedIndexes:changedIndexes
203-
coalescingKey:0];
204+
coalescingKey:_coalescingKey];
204205
[_eventDispatcher sendEvent:event];
205206
}
206207

@@ -233,6 +234,7 @@ - (void)handleGestureUpdate:(__unused UIGestureRecognizer *)gesture
233234
{
234235
// If gesture just recognized, send all touches to JS as if they just began.
235236
if (self.state == UIGestureRecognizerStateBegan) {
237+
_coalescingKey++;
236238
[self _updateAndDispatchTouches:_nativeTouches.set eventName:@"topTouchStart" originatingTime:0];
237239

238240
// We store this flag separately from `state` because after a gesture is

0 commit comments

Comments
 (0)