mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-05 21:24:45 +00:00
Issue 2821: prevented caling blur() on a body element, causes bug in IE8
This commit is contained in:
parent
85927d3995
commit
8387919d26
1 changed files with 7 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue