Skip to content

Commit 17cb70e

Browse files
sebmarkbagefacebook-github-bot
authored andcommitted
Apply numeric text event bubbling fix for Android
Reviewed By: bvaughn Differential Revision: D4726029 fbshipit-source-id: 94c8025bb59cc0970b6cc8ce7f3caf6e867bf72b
1 parent b1a63f0 commit 17cb70e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Libraries/Renderer/src/renderers/shared/shared/event/EventPluginHub.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,22 @@ var EventPluginHub = {
138138
return null;
139139
}
140140
} else {
141-
if (typeof inst._currentElement === 'string') {
141+
const currentElement = inst._currentElement;
142+
if (
143+
typeof currentElement === 'string' || typeof currentElement === 'number'
144+
) {
142145
// Text node, let it bubble through.
143146
return null;
144147
}
145148
if (!inst._rootNodeID) {
146149
// If the instance is already unmounted, we have no listeners.
147150
return null;
148151
}
149-
const props = inst._currentElement.props;
150-
if (!props) {
151-
return null;
152-
}
152+
const props = currentElement.props;
153153
listener = props[registrationName];
154-
if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, props)) {
154+
if (
155+
shouldPreventMouseEvent(registrationName, currentElement.type, props)
156+
) {
155157
return null;
156158
}
157159
}

0 commit comments

Comments
 (0)