[fix] View event handling

Fix #238
This commit is contained in:
Nicolas Gallagher
2016-10-27 21:00:17 -07:00
parent 0af6dc00fc
commit 14072c7471
2 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -124,10 +124,10 @@ class View extends Component {
_normalizeEventForHandler(handler, handlerName) {
// Browsers fire mouse events after touch events. This causes the
// ResponderEvents and their handlers to fire twice for Touchables.
// 'onResponderRelease' handler to be called twice for Touchables.
// Auto-fix this issue by calling 'preventDefault' to cancel the mouse
// events.
const shouldCancelEvent = handlerName.indexOf('onResponder') === 0;
const shouldCancelEvent = handlerName === 'onResponderRelease';
return (e) => {
e.nativeEvent = normalizeNativeEvent(e.nativeEvent);