jQuery Mobile pages crash in mobile Safari when tapping away from select (iOS 8) #7685

ptrln opened this Issue Sep 18, 2014 · 27 comments
ptrln commented Sep 18, 2014

Issue description

After updating to iOS 8, every time you tap away from a select, the page crashes, and this error is displayed: A problem has occurred with this webpage so it was reloaded.

Test page (see below)


Steps to reproduce

  1. Click on the select
  2. Select an option (other than the one already selected)
  3. Press the angle right icon to "tap" to the next select.
  4. Page crashes

Expected outcome

Go to the next input.

Actual outcome

Page crashes and reloads.

Platforms/browsers (including version) and devices tested

Mobile Safari on iOS 8 on iPhone 5, iOS 8 on iPhone 5s. Works in Chrome for iPhone.

jQuery Mobile and jQuery core version used

jQM: 1.4.4
jQuery: 1.10.2


ptrln commented Sep 18, 2014

Also affects jQM 1.3.2.

Older versions seem to be fine.

@ptrln ptrln changed the title from jQuery Mobile pages crash in mobile Safari when tapping away from select to jQuery Mobile pages crash in mobile Safari when tapping away from select (iOS 8) Sep 18, 2014
slavap commented Sep 19, 2014

I'm able to reproduce this bug on iPod Touch, iOS8, Safari. Looks like it's not jqm bug, but rather iOS8 problem. It's not always reproducible, for example starts working after using Done in the same dialog.


I can confirm this issue and will look into what we can do here this is a pretty major issue!

@jaspermdegroot jaspermdegroot added this to the 1.5.0 milestone Sep 20, 2014

Is this a duplicate of #7216?


No its only iOS8 its not multi-select and its not when you select its only if you try to jump to the next input with the soft keyboard shortcut.

@jaspermdegroot jaspermdegroot modified the milestone: 1.4.5, 1.5.0 Sep 20, 2014

Thanks to a colleague with an iOS8 device, I was able to find the root cause of the problem. If you comment the blur() in the change event handler it no longer crashes.


A quick git blame reveals that we added the blur in order to fix #5514.


It also breaks with just plain JS: http://jsbin.com/IFolanOW/598/


A possible workaround is to unwind the stack and then blur: http://jsbin.com/IFolanOW/599/, however, we need to check whether that re-introduces #5514.


Well, actually, after reading #5514 and #6028, it sounds like we need a different solution to #5514.


This was fixed by ios 8.0.2 update closing as fixed

@arschmitz arschmitz closed this Oct 10, 2014
ndrake commented Oct 10, 2014

I'm still able to reproduce this issue with iOS 8.0.2 following the reproduction steps in the initial bug report.


@ndrake ah shoot your right i missed the step of selecting another option. So much for hoping apple fixed this...

@arschmitz arschmitz reopened this Oct 10, 2014

Following the reproduction steps in the initial bug report I'm able to reproduce this issue using iOS 8.1.

silva96 commented Oct 22, 2014

On 8.1

The problem for us is occurring on a web app with meta "apple-mobile-web-app-capable", when launching the app from the home screen the browser interface isn't showed (normal behaviour). clicking around a few times the select and the screen makes safari crash. This doesn't happen inside a normal safari window (only fullscreen windows made it crash).

One more fact is that, this isn't probably a problem of jquerymobile, since we disabled the jquerymobile behaviour on selects (via data-role="none") and used native html5 select and still have the same issue.

Probably I should post something on safario for iOs developers forum, but I cant find where is that.

UPDATE: please try to reproduce this:
enter http://greenti.cl/test.html with safari in iOS 8, save it to home screen. Enter via icon in homescreen, mess around with any of the selects. Crashes?

@gabrielschulhof gabrielschulhof added a commit that referenced this issue Oct 24, 2014
@gabrielschulhof gabrielschulhof Select: Unwind stack before blur()ing in response to change
(cherry picked from commit 32bc2e9)

Closes gh-7723
Fixes gh-7685
@agcolom agcolom added a commit to agcolom/jquery-mobile that referenced this issue Nov 26, 2014
@gabrielschulhof @agcolom gabrielschulhof + agcolom Select: Unwind stack before blur()ing in response to change
Closes gh-7723
Fixes gh-7685
sstadtl commented Jan 15, 2015

This Bug still haunts me.
Using http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js

If i edit the source and change the following it stops crashing, but i have no clue what i am breaking :(

if ( !!options.nativeMenu ) {
  // self._delay( function() {
  // self.select.blur();
  // });

(Using iPhone 6 with Firmware 8.1.2)


I can confirm there are problems with iPad / iOS 8.1.3, using the test page provided http://greenti.cl/test.html (thanks @silva96). However, as that test page is basic HTML5 only, this is definitely a core Safari issue and nothing to do with jQuery mobile, or even javascript for that matter.

I'm posting this here as I'm sure others will find this issue as I did. I have submitted a bug report to Apple, as I'm sure others have. Anyone reading this, if you have time please do the same!

silva96 commented Feb 20, 2015

I already posted in bug report from Apple, they say I had to post the
debug log but I haven't.

But this is a native bug, nothing to do with jquery mobile, so here is my
stackoverflow question



I can confirm that this issue still exists in iOS 8.2. I don't think its a JQM bug, rather a Safari bug.

The log shows the following error: : *** Terminating app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController (<UIPopoverPresentationController: 0x146de44f0>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.'

ghost commented Apr 15, 2015

I cannot replicate this issue on iOS 8.3 - I believe it is fixed now.


Unfortunately I can still reproduce this bug on iOS 8.3, its definitely not fixed. Tested it on an iPad Mini. Try spamming the combo box with your finger.


The issue is fixed with new jquery 1.11.3
Please read this article http://blog.jquery.com/2014/12/18/jquery-1-11-2-and-2-1-3-released-safari-fail-safe-edition/


It's not crashing for me on iOS 8.4


@bmcnamar are you using latest jquery this was fixed in core


I went to this page: http://demos.jquerymobile.com/1.4.4/selectmenu/ (the one posted above)
on iPhone 5s running iOS 8.4


still having some issues .. Do anyone know how to fix this?


@bmcnamar @olivalcf that page will not work this is only fixed with jQuery core 1.11.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment