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

native select mallfunctions on iPad/iPhone when including jQuery-Mobile #1163

Closed
sjoerdmulder opened this issue Mar 1, 2011 · 10 comments
Closed

Comments

@sjoerdmulder
Copy link

Version 1.0a3

Have strange behavior with a select. Set the $.mobile.page.prototype.options.keepNative = "select" option so the select replacement is not causing it

After profiling only 4 methods found that could be the cause. It appears that return false in a mousedown event is making iPhone / iPad go bizarre with a select.

You can only select it once, it will not fire change event and not close on selecting an option. After that it will not open at all anymore.

Cause in JQuery Mobile:
jquery.mobile.event.js: line 68 return false

Simple testcase: (requires only jQuery, no mobile)

http://jsbin.com/uwoke3

@toddparker
Copy link
Contributor

Can you set up a test page on JS bin? Like this:
http://jsbin.com/alayo3/

@sjoerdmulder
Copy link
Author

Added:
http://jsbin.com/uwoke3

@toddparker
Copy link
Contributor

That demo only seems to included jQuery 1.5.1, not jQuery Mobile. Are you saying there is a bug with jQuery core, not mobile? The title says mobile, but your description and demo seem to indicate this is a core issue.

@sjoerdmulder
Copy link
Author

The demo is without JQuery Mobile because its difficult to pin-point the problem. The problem is in JQuery Mobile, not JQuery core, i have already boiled it down for you :)...

See: http://jsbin.com/uwoke3/3 for a testcase with the same issue

The cause is in JQuery Mobile:
jquery.mobile.event.js: line 68
It return false on a mousedown event

@sjoerdmulder
Copy link
Author

Ahhh... what a terrible bug tracking system is this :S How to reopen an issue?

@toddparker
Copy link
Contributor

Re-opened. They really need to get rid of the "comment and close" button!

Ok, we'll take a look.

@toddparker
Copy link
Contributor

Is this still an issue? Selects seem to work fine in all permutations and this is a pretty ancient issue.

@sjoerdmulder
Copy link
Author

Yes, just reproduced it with an iPhone 4 and the test URL:

  • tap the Select
  • notice the native pulldown of the iOS showing
  • select another value and tap the blue "Ready" or "Okay" button (not sure what it says in english).
    Notice that you will not beable to close the iOS pulldown. The blue button doesnt work

See: #2238 for a proposed fix ;-)

@sjoerdmulder
Copy link
Author

Oops my bad.. i should have updated the testcase to the newest version of jquery mobile ;-)

The problem seems to be resolved, probably because the mouseevent is now vmousedown and not mousedown and so the return value of a event handler is not passed through to the browser anymore.

If you want you can close this issue

@toddparker
Copy link
Contributor

So it seems that this can be closed. Thanks .sjoerdmulder

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants