Use getActiveElement module

We had something that did the same sort of protection. The module
differs slightly (returns document.body instead of undefined) but
looking at the callers, that should be ok.
This commit is contained in:
Paul O'Shannessy authored and Paul O’Shannessy committed 2013-10-15 18:00:05 -07:00
1 parent 46713c3d7d
commit 3f2ba221ef
1 file changed
+1 -9
+1 -9
View File
@@ -20,17 +20,9 @@
var ReactDOMSelection = require('ReactDOMSelection');
var getActiveElement = require('getActiveElement');
var nodeContains = require('nodeContains');
// It is not safe to read the document.activeElement property in IE if there's
// nothing focused.
function getActiveElement() {
try {
return document.activeElement;
} catch (e) {
}
}
function isInDocument(node) {
return nodeContains(document.documentElement, node);
}