mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-22 11:35:01 +08:00
Dispatch native handled events to JS
Summary: When native events where handled they were not sent to JS as an optimization but this caused some issues. One of the major one is touches are not handled properly inside a ScrollView with an Animated.event because it doesn't receive scroll events so it can't cancel the touch if the user scrolled. Closes https://github.com/facebook/react-native/pull/10981 Differential Revision: D4226403 Pulled By: astreet fbshipit-source-id: 41278d3ed4b684af142d9e273b11b974eb679879
This commit is contained in:
committed by
Facebook Github Bot
parent
dad520476e
commit
b49e7afe47
@@ -322,11 +322,11 @@ RCT_EXPORT_METHOD(removeAnimatedEventFromView:(nonnull NSNumber *)viewTag
|
||||
body:@{@"tag": node.nodeTag, @"value": @(value)}];
|
||||
}
|
||||
|
||||
- (BOOL)eventDispatcherWillDispatchEvent:(id<RCTEvent>)event
|
||||
- (void)eventDispatcherWillDispatchEvent:(id<RCTEvent>)event
|
||||
{
|
||||
// Native animated events only work for events dispatched from the main queue.
|
||||
if (!RCTIsMainQueue() || _eventAnimationDrivers.count == 0) {
|
||||
return NO;
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *key = [NSString stringWithFormat:@"%@%@", event.viewTag, event.eventName];
|
||||
@@ -336,11 +336,7 @@ RCT_EXPORT_METHOD(removeAnimatedEventFromView:(nonnull NSNumber *)viewTag
|
||||
[driver updateWithEvent:event];
|
||||
[self updateViewsProps];
|
||||
[driver.valueNode cleanupAnimationUpdate];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)updateViewsProps
|
||||
|
||||
Reference in New Issue
Block a user