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:
Janic Duplessis
2016-11-23 05:35:34 -08:00
committed by Facebook Github Bot
parent dad520476e
commit b49e7afe47
6 changed files with 9 additions and 33 deletions

View File

@@ -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