[Fixed] Click event not suppressed

339 views
Skip to first unread message

jlgrall

unread,
Nov 23, 2011, 2:24:11 PM11/23/11
to threedubmedia
With recent versions of jQuery, the click event is not suppressed at
the end of the drag.

Here is a demo of the bug:
http://jsfiddle.net/jlgrall/HRLwY/

My tests show that it worked until jQuery 1.5.1, then since jQuery
1.5.2 it is broken.

Then I compared both version of jQuery, and I think I found the
problem. Compare the line 2200 in jQuery 1.5.1 with the line 2206 in
jQuery 1.5.2. In the old version jQuery.event.triggered only contains
a boolean, in the new version it contains a string that is an
event.type or the value undefined.

Back to jquery.event.drag, lines 205 and 207. I just change them as
follows:
jQuery.event.triggered = true; -> jQuery.event.triggered = "click";
jQuery.event.triggered = false; -> jQuery.event.triggered = undefined;

Now it seems to be working well.
(I have only done basic testing with jQuery 1.7.1)

Hope it helps other people,

JL

ghba...@gmail.com

unread,
Feb 18, 2012, 11:15:22 PM2/18/12
to threed...@googlegroups.com
Thanks JL! Your suggestion seemed to fix my issue with jQuery 1.7. .. If anyone knows of a better way to use drag events than ThreeDubMedia's extension, let me know.

xda...@gmail.com

unread,
Mar 6, 2012, 2:18:07 PM3/6/12
to threed...@googlegroups.com
Doesn't work for me :-/

Is the author still alive and maintaining the library?

I couldn't find any other patch elsewhere. 

Just found another person reporting the same issue and saying that replacing .live with .on works but then new elements are not draggable:



On Saturday, February 18, 2012 8:15:22 PM UTC-8, ghba...@gmail.com wrote:
Thanks JL! Your suggestion seemed to fix my issue with jQuery 1.7. .. If anyone knows of a better way to use drag events than ThreeDubMedia's extension, let me know.

Reply all
Reply to author
Forward
0 new messages