Skip to main content

Search and Top Navigation

#3177 closed bug (fixed)

Opened August 12, 2008 11:30PM UTC

Closed October 13, 2015 06:15PM UTC

click is fired for draggagble elements on mouseUp

Reported by: paul.p.carey@gmail.com Owned by:
Priority: major Milestone: 1.7
Component: ui.mouse Version: 1.6rc2
Keywords: click mouseup drag Cc:
Blocked by: Blocking:
Description

Functions bound to the click event of an element are fired when a drag is terminated - on the mouseUp event.

I consider this a bug as dragging and clicking are distinct actions.

Attachments (1)
Change History (12)

Changed August 16, 2008 08:16PM UTC by Cloudream comment:1

milestone: → TDB

Changed November 03, 2008 12:45PM UTC by paul comment:2

milestone: TBD1.6
resolution: → fixed
status: newclosed
version: 1.5.21.6rc2

Fixed in r856.

Changed February 06, 2009 02:09PM UTC by paul.p.carey@gmail.com comment:3

This still occurs in 1.6rc6.

<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01EN" "http:www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>

<script src="http://ui.jquery.com/repository/tags/testing/ui/minified/jquery.ui.all.min.js" type="text/javascript"></script>

<script type="text/javascript">

$(document).ready(function () {

$("#foo").draggable();

$("#foo").click(function () { console.log("fired!"); });

});

</script>

</head>

<body><div id="foo">foo</div></body>

</html>

Changed February 13, 2009 05:16AM UTC by scottgonzalez comment:4

component: ui.draggableui.core
priority: minorblocker
resolution: fixed
status: closedreopened

A partial fix that's doable right now is to add in event.stopImmediatePropagation() in the click handler. This will work for this test case, but not for the case where the original click event is bound before the element is made draggable.

A proper fix for this requires the ability to always be able to bind a handler as the first handler. I've talked to Ariel about this and have some ideas that I'll try out tomorrow.

Changed February 13, 2009 01:40PM UTC by scottgonzalez comment:5

owner: paulscott.gonzalez
status: reopenedaccepted

Changed February 14, 2009 02:59AM UTC by scottgonzalez comment:6

Proposed solution on jquery-dev.

Changed February 14, 2009 03:03AM UTC by scottgonzalez comment:7

milestone: 1.61.next
owner: scott.gonzalez
status: acceptedassigned

Fixed for the case where the user's click events are bound after the element is made draggable in r2080.

Bumping to 1.next for a more complete solution (too large of an impact this late in the release cycle).

Changed July 30, 2010 10:14AM UTC by jzaefferer comment:8

component: ui.coreui.mouse

Should be handled as part of the interactions rewrite.

Changed July 30, 2010 10:15AM UTC by jzaefferer comment:9

priority: blockercritical

Changed October 19, 2010 03:43PM UTC by scottgonzalez comment:10

priority: criticalmajor

Changed October 03, 2012 03:34PM UTC by scottgonzalez comment:11

milestone: 1.next2.0.0
status: assignedopen

Changed October 13, 2015 06:15PM UTC by scottgonzalez comment:12

milestone: 2.0.01.7
resolution: → fixed
status: openclosed

I'm going to close this as fixed in 1.7. The more complete solution that I proposed a long time ago isn't something we should really implement.