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 comment:1
milestone: | → TDB |
---|
Changed November 03, 2008 12:45PM UTC by comment:2
milestone: | TBD → 1.6 |
---|---|
resolution: | → fixed |
status: | new → closed |
version: | 1.5.2 → 1.6rc2 |
Fixed in r856.
Changed February 06, 2009 02:09PM UTC by 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 comment:4
component: | ui.draggable → ui.core |
---|---|
priority: | minor → blocker |
resolution: | fixed |
status: | closed → reopened |
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 comment:5
owner: | paul → scott.gonzalez |
---|---|
status: | reopened → accepted |
Changed February 14, 2009 02:59AM UTC by comment:6
Proposed solution on jquery-dev.
Changed February 14, 2009 03:03AM UTC by comment:7
milestone: | 1.6 → 1.next |
---|---|
owner: | scott.gonzalez |
status: | accepted → assigned |
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 comment:8
component: | ui.core → ui.mouse |
---|
Should be handled as part of the interactions rewrite.
Changed July 30, 2010 10:15AM UTC by comment:9
priority: | blocker → critical |
---|
Changed October 19, 2010 03:43PM UTC by comment:10
priority: | critical → major |
---|
Changed October 03, 2012 03:34PM UTC by comment:11
milestone: | 1.next → 2.0.0 |
---|---|
status: | assigned → open |
Changed October 13, 2015 06:15PM UTC by comment:12
milestone: | 2.0.0 → 1.7 |
---|---|
resolution: | → fixed |
status: | open → closed |
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.