mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
Fix Undefined ownerDocument Fatal in IE8
This fixes a JS fatal in IE8 when `topLevelTarget.ownerDocument` is sometimes undefined.
This commit is contained in:
parent
73d9d286ee
commit
f71dbab31a
|
|
@ -82,12 +82,17 @@ var EnterLeaveEventPlugin = {
|
|||
}
|
||||
|
||||
var win;
|
||||
if (topLevelTarget != null && topLevelTarget.window === topLevelTarget) {
|
||||
// topLevelTarget probably is a window object
|
||||
if (topLevelTarget.window === topLevelTarget) {
|
||||
// `topLevelTarget` is probably a window object.
|
||||
win = topLevelTarget;
|
||||
} else {
|
||||
// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
|
||||
var doc = topLevelTarget.ownerDocument;
|
||||
win = doc.defaultView || doc.parentWindow;
|
||||
if (doc) {
|
||||
win = doc.defaultView || doc.parentWindow;
|
||||
} else {
|
||||
win = window;
|
||||
}
|
||||
}
|
||||
|
||||
var from, to;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user