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.
This commit is contained in:
CommitSyncScript
2013-06-10 16:16:30 -07:00
committed by Paul O’Shannessy
parent b3e0dc47a8
commit c2ce1d00cd
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -68,6 +68,11 @@ var ReactEventTopLevelCallback = {
if (!_topLevelListenersEnabled) {
return;
}
// TODO: Remove when synthetic events are ready, this is for IE<9.
if (nativeEvent.srcElement &&
nativeEvent.srcElement !== nativeEvent.target) {
nativeEvent.target = nativeEvent.srcElement;
}
var topLevelTarget = ReactInstanceHandles.getFirstReactDOM(
getEventTarget(nativeEvent)
) || ExecutionEnvironment.global;
+1 -1
View File
@@ -258,7 +258,7 @@ var ReactInstanceHandles = {
* Traverses up the ancestors of the supplied node to find a node that is a
* DOM representation of a React component.
*
* @param {?DOMEventTarget} node
* @param {*} node
* @return {?DOMEventTarget}
* @internal
*/