Permalink
Browse files

Apply numeric text event bubbling fix for Android

Reviewed By: bvaughn

Differential Revision: D4726029

fbshipit-source-id: 94c8025bb59cc0970b6cc8ce7f3caf6e867bf72b
  • Loading branch information...
sebmarkbage authored and facebook-github-bot committed Mar 17, 2017
1 parent b1a63f0 commit 17cb70efdd1ed6378677e720a022c9d83ad87dd6
Showing with 8 additions and 6 deletions.
  1. +8 −6 Libraries/Renderer/src/renderers/shared/shared/event/EventPluginHub.js
@@ -138,20 +138,22 @@ var EventPluginHub = {
return null;
}
} else {
if (typeof inst._currentElement === 'string') {
const currentElement = inst._currentElement;
if (
typeof currentElement === 'string' || typeof currentElement === 'number'
) {
// Text node, let it bubble through.
return null;
}
if (!inst._rootNodeID) {
// If the instance is already unmounted, we have no listeners.
return null;
}
const props = inst._currentElement.props;
if (!props) {
return null;
}
const props = currentElement.props;
listener = props[registrationName];
if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, props)) {
if (
shouldPreventMouseEvent(registrationName, currentElement.type, props)
) {
return null;
}
}

0 comments on commit 17cb70e

Please sign in to comment.