From 8387919d26f7a0c283e556b93f3fb240ef92ba7b Mon Sep 17 00:00:00 2001 From: Petko Bossakov Date: Wed, 2 Nov 2011 22:09:25 +0200 Subject: [PATCH] Issue 2821: prevented caling blur() on a body element, causes bug in IE8 --- js/jquery.mobile.navigation.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 0323f632..68262f87 100755 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -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