Set viewTag for RCTTouchEvent to avoid EventID conflict
Summary: Using target view's reactTag as viewTag for RCTTouchEvent. Fix issue https://github.com/facebook/react-native/issues/9503 Closes https://github.com/facebook/react-native/pull/9952 Differential Revision: D3880152 Pulled By: majak fbshipit-source-id: 1025aae6a6a1d5074496a9e4a6cf7dfebc713dc7
This commit is contained in:
parent
b62ed2f291
commit
610c4826a5
|
@ -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;
|
||||
|
|
|
@ -21,11 +21,13 @@
|
|||
@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;
|
||||
|
|
|
@ -199,6 +199,7 @@ typedef NS_ENUM(NSInteger, RCTTouchEventType) {
|
|||
}
|
||||
|
||||
RCTTouchEvent *event = [[RCTTouchEvent alloc] initWithEventName:eventName
|
||||
reactTag:self.view.reactTag
|
||||
reactTouches:reactTouches
|
||||
changedIndexes:changedIndexes
|
||||
coalescingKey:_coalescingKey];
|
||||
|
|
Loading…
Reference in New Issue