Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Holding down on text in iOS does not bring up the 'copy' button on jQueryMobile Dialog when using ajax #4322

alexboots opened this Issue · 4 comments

5 participants


I am talking about one of these Dialog boxes that pop up:

(short url for mobile

Click 'Open Dialog' -- on that dialog box, nothing is copy-able in iOS without 'data-ajax="false"' in the the link. (works fine on Android)

Putting '-webkit-user-select: auto!important;' (or 'text' instead of 'auto') does nothing.

Adding the javascript ' = "auto";' does nothing.

tested on 4.3.5 -- 4.3.2 -- iOS 5.1

Edit:: the issue has been answered here (what to remove to make it work)

Problem lies quite deep in the code of this framework. First of all we have a file in which we have a line:

$el.bind( "vclick submit", function( event ) {
           // code

As you can see here we are adding a binding vclick to the $el - whole dialog box container.

Event vclick on it's own is generated by jQuery Mobile in vmouse.js and after digging there i managed to detect where actual problem arises:

$( this ).bind( realType, dummyMouseHandler );

This line is required to make event work in some browsers, namely Opera Mini (as described in commented text above this line).

So, here is one of the solutions, open file and comment out line

$( this ).bind( realType, dummyMouseHandler );

I've tested it on an iPad and copy functionality is available after that tiny patch.

@jblas jblas was assigned

@jblas - Can you comment on the impact of this change on vmouse?


As @alexboots Mentioned above, I added it to get opera mini to work. Opera mini, as well as some other browsers, won't dispatch a mouse event for a given element unless it actually has an event listener for that event on it. Without that dummy listener mouse events weren't happening at all.

I'm not sure why it breaks iOS ... I guess the question is if you click and hold on an event with legitimate handler on it, does it behave the same? Note that we are only installing handlers on elements that we were explicitly asked to install the v-event on. In other words if you switched the event you are binding to from vmousedown to say mousedown, does the problem still happen?


Hey @toddparker and @jblas It's been a couple years since anyone has commented on this issue. Can you guys confirm whether or not this is still an issue with the latest JQM?


Closing as wont fix dialogs are deprecated in 1.4 and we wont be fixing any thing with vmouse as we are replacing with a pointer event polyfill.

@arschmitz arschmitz closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.