Skip to content

Commit

Permalink
Set viewTag for RCTTouchEvent to avoid EventID conflict
Browse files Browse the repository at this point in the history
Summary:
Using target view's reactTag as viewTag for RCTTouchEvent.

Fix issue #9503
Closes #9952

Differential Revision: D3880152

Pulled By: majak

fbshipit-source-id: 1025aae6a6a1d5074496a9e4a6cf7dfebc713dc7
  • Loading branch information
littlesome authored and Facebook Github Bot 3 committed Sep 16, 2016
1 parent b62ed2f commit 610c482
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions React/Base/RCTTouchEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@interface RCTTouchEvent : NSObject <RCTEvent>

- (instancetype)initWithEventName:(NSString *)eventName
reactTag:(NSNumber *)reactTag
reactTouches:(NSArray<NSDictionary *> *)reactTouches
changedIndexes:(NSArray<NSNumber *> *)changedIndexes
coalescingKey:(uint16_t)coalescingKey NS_DESIGNATED_INITIALIZER;
Expand Down
2 changes: 2 additions & 0 deletions React/Base/RCTTouchEvent.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ @implementation RCTTouchEvent
@synthesize viewTag = _viewTag;

- (instancetype)initWithEventName:(NSString *)eventName
reactTag:(NSNumber *)reactTag
reactTouches:(NSArray<NSDictionary *> *)reactTouches
changedIndexes:(NSArray<NSNumber *> *)changedIndexes
coalescingKey:(uint16_t)coalescingKey
{
if (self = [super init]) {
_viewTag = reactTag;
_eventName = eventName;
_reactTouches = reactTouches;
_changedIndexes = changedIndexes;
Expand Down
1 change: 1 addition & 0 deletions React/Base/RCTTouchHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ - (void)_updateAndDispatchTouches:(NSSet<UITouch *> *)touches
}

RCTTouchEvent *event = [[RCTTouchEvent alloc] initWithEventName:eventName
reactTag:self.view.reactTag
reactTouches:reactTouches
changedIndexes:changedIndexes
coalescingKey:_coalescingKey];
Expand Down

0 comments on commit 610c482

Please sign in to comment.