]> source.dussan.org Git - jquery-ui.git/commitdiff
Core: Handle IE11 bug with document.activeElement in iframes
authorScott González <scott.gonzalez@gmail.com>
Tue, 24 Mar 2015 18:10:37 +0000 (14:10 -0400)
committerScott González <scott.gonzalez@gmail.com>
Tue, 24 Mar 2015 22:28:12 +0000 (18:28 -0400)
Fixes #11539
Closes gh-1518

ui/core.js

index eaf11d0a82b76dbf299a7c85505074467466cd49..a8167d68318397d36aed2bb5662296b7bed35206 100644 (file)
@@ -63,6 +63,13 @@ $.extend( $.ui, {
                        activeElement = document.body;
                }
 
+               // Support: IE 11 only
+               // IE11 returns a seemingly empty object in some cases when accessing
+               // document.activeElement from an <iframe>
+               if ( !activeElement.nodeName ) {
+                       activeElement = document.body;
+               }
+
                return activeElement;
        },