Thom Shutt
Thom Shutt

Reputation: 449

JQuery Mobile causes Internet Explorer window to be sent to background on load

I've hit this bug:

https://github.com/jquery/jquery-mobile/issues/2057

The proposed solution doesn't work for me however because I have the JQM code running in an iframe.

Any suggestions for a workaround until it's fixed? Late-initialising the source of the iframe doesn't help - it just delays the issue.

Upvotes: 2

Views: 477

Answers (1)

Thom Shutt
Thom Shutt

Reputation: 449

Found the offending code:

// Kill the keyboard.
// XXX_jblas: We need to stop crawling the entire document to kill focus. Instead,
//            we should be tracking focus with a live() handler so we already have
//            the element in hand at this point.
// 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();
 } catch(e) {}

Commenting out those three lines fixes the problem. The JQM team have re-opened the bug and are looking into it further.

Upvotes: 1

Related Questions