Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Issue 2821: prevented caling blur() on a body element, causes bug in IE8
Browse files Browse the repository at this point in the history
  • Loading branch information
pbosakov committed Nov 2, 2011
1 parent 85927d3 commit 8387919
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/jquery.mobile.navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,13 @@
// Wrap this in a try/catch block since IE9 throw "Unspecified error" if document.activeElement
// is undefined when we are in an IFrame.
try {
$( document.activeElement || "" ).add( "input:focus, textarea:focus, select:focus" ).blur();
if(document.activeElement) {
if(document.activeElement.nodeName.toLowerCase() != 'body') {
document.activeElement.blur();
}
} else {
$( "input:focus, textarea:focus, select:focus" ).blur();
}
} catch(e) {}

// If we're displaying the page as a dialog, we don't want the url
Expand Down

0 comments on commit 8387919

Please sign in to comment.