]> source.dussan.org Git - jquery-ui.git/commitdiff
Core: Work around more IE activeElement bugs
authorScott González <scott.gonzalez@gmail.com>
Fri, 27 Mar 2015 16:00:55 +0000 (12:00 -0400)
committerScott González <scott.gonzalez@gmail.com>
Thu, 9 Jun 2016 17:21:51 +0000 (13:21 -0400)
Closes gh-1523

(cherry picked from commit 0de27b0609e8f6f9751ab7cce28492e18206d86d)

ui/core.js

index 1e40c94432b76cd7e577478c2f6629af67a30f0a..e712bcebb068443b6d973f4fe0ec6650cd7a76fa 100644 (file)
@@ -57,6 +57,13 @@ $.extend( $.ui, {
                        activeElement = document.body;
                }
 
+               // Support: IE 9 - 11 only
+               // IE may return null instead of an element
+               // Interestingly, this only seems to occur when NOT in an iframe
+               if ( !activeElement ) {
+                       activeElement = document.body;
+               }
+
                // Support: IE 11 only
                // IE11 returns a seemingly empty object in some cases when accessing
                // document.activeElement from an <iframe>