mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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:
committed by
Paul O’Shannessy
parent
b3e0dc47a8
commit
c2ce1d00cd
@@ -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;
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user