@samitouri / QOS-React-2 / commits / c2ce1d00cd
Fork 0

The library for web and native user interfaces.

Fix Event Normalization in IE<9

IE<9 relied on the `target` property being overriden. This adds back a hack that only applies in IE<9. I'll be able to revert this hack once I check in synthetic events.

CommitSyncScript committed Jun 10, 2013 at 16:16 UTC c2ce1d00cded131eefd0ab90f626e4cdb1187ff2
2 files changed +6 -1
src/core/ReactEventTopLevelCallback.js
+5
@@ -68,6 +68,11 @@ var ReactEventTopLevelCallback = {
68 if (!_topLevelListenersEnabled) {
69 return;
70 }
71 + // TODO: Remove when synthetic events are ready, this is for IE<9.
72 + if (nativeEvent.srcElement &&
73 + nativeEvent.srcElement !== nativeEvent.target) {
74 + nativeEvent.target = nativeEvent.srcElement;
75 + }
76 var topLevelTarget = ReactInstanceHandles.getFirstReactDOM(
77 getEventTarget(nativeEvent)
78 ) || ExecutionEnvironment.global;
src/core/ReactInstanceHandles.js
+1 -1
@@ -258,7 +258,7 @@ var ReactInstanceHandles = {
258 * Traverses up the ancestors of the supplied node to find a node that is a
259 * DOM representation of a React component.
260 *
261 - * @param {?DOMEventTarget} node
261 + * @param {*} node
262 * @return {?DOMEventTarget}
263 * @internal
264 */