Skip to content

Commit 6066f49

Browse files
committed
Fallback to event.srcElement for IE9
It looks like we accidentally removed a fallback condition for the event target in IE9 when we dropped some support for IE8. This commit adds the event target specific support code back to getEventTarget.js Fixes #12506
1 parent c5a733e commit 6066f49

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-dom/src/events/getEventTarget.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ import {TEXT_NODE} from '../shared/HTMLNodeType';
1515
* @return {DOMEventTarget} Target node.
1616
*/
1717
function getEventTarget(nativeEvent) {
18-
let target = nativeEvent.target || window;
18+
// Fallback to nativeEvent.srcElement for IE9
19+
// https://github.com/facebook/react/issues/12506
20+
let target = nativeEvent.target || nativeEvent.srcElement || window;
1921

2022
// Normalize SVG <use> element events #4963
2123
if (target.correspondingUseElement) {

0 commit comments

Comments
 (0)