Skip to content

Commit b14dd31

Browse files
TrueEddiearschmitz
authored andcommitted
Popup: do not call blur if the target is the body
In IE 10 (and possibly older versions of IE) when there is a single tab open and a popup is displayed and there is another window on the same monitor, calling target.blur() can cause the browser to go to the background because the body element is the targetElement. Ensuring the element is not the body element before calling blur() fixes this issue. Fixes jquery-archivegh-7639 Closes jquery-archivegh-7298
1 parent f0362f4 commit b14dd31

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

js/widgets/popup.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,9 @@ $.widget( "mobile.popup", {
299299
target = $( targetElement );
300300
if ( 0 === target.parents().filter( ui.container[ 0 ] ).length ) {
301301
$( this.document[ 0 ].activeElement ).one( "focus", function(/* theEvent */) {
302-
target.blur();
302+
if ( targetElement.nodeName.toLowerCase() !== "body" ) {
303+
target.blur();
304+
}
303305
});
304306
ui.focusElement.focus();
305307
theEvent.preventDefault();

0 commit comments

Comments
 (0)