diff --git a/lib/helpers/focusManager.js b/lib/helpers/focusManager.js index 38b854a2..953b66cb 100644 --- a/lib/helpers/focusManager.js +++ b/lib/helpers/focusManager.js @@ -10,6 +10,9 @@ function handleBlur(event) { function handleFocus(event) { if (needToFocus) { needToFocus = false; + if (!modalElement) { + return; + } // need to see how jQuery shims document.on('focusin') so we don't need the // setTimeout, firefox doesn't support focusin, if it did, we could focus // the the element outisde of a setTimeout. Side-effect of this