]> 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>
Thu, 9 Jun 2016 16:37:37 +0000 (12:37 -0400)
Fixes #11539
Closes gh-1518

(cherry picked from commit 76c27556f48bea48d3787c241d35e190d46c3245)

ui/core.js

index 40703d73dd2ffeff466e35b31b770e910e538f06..462d10bb8dbf9dbb517021a604eb0415bb6f0287 100644 (file)
@@ -57,6 +57,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;
        },