From 3f2ba221ef3cb514d15680b7736c37b016aa2064 Mon Sep 17 00:00:00 2001 From: Paul O'Shannessy Date: Tue, 15 Oct 2013 17:57:54 -0700 Subject: [PATCH] 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. --- src/core/ReactInputSelection.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/core/ReactInputSelection.js b/src/core/ReactInputSelection.js index f680717277..b1d9abfd22 100644 --- a/src/core/ReactInputSelection.js +++ b/src/core/ReactInputSelection.js @@ -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); }