Opened 15 years ago
Closed 8 years ago
#3177 closed bug (fixed)
click is fired for draggagble elements on mouseUp
Reported by: | 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 (13)
comment:1 Changed 15 years ago by
Milestone: | → TDB |
---|
comment:2 Changed 15 years ago by
Milestone: | TBD → 1.6 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Version: | 1.5.2 → 1.6rc2 |
comment:3 Changed 14 years ago by
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>
comment:4 Changed 14 years ago by
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.
comment:5 Changed 14 years ago by
Owner: | changed from paul to scott.gonzalez |
---|---|
Status: | reopened → accepted |
Changed 14 years ago by
Attachment: | click-prevention.patch added |
---|
comment:7 Changed 14 years ago by
Milestone: | 1.6 → 1.next |
---|---|
Owner: | scott.gonzalez deleted |
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).
comment:8 Changed 13 years ago by
Component: | ui.core → ui.mouse |
---|
Should be handled as part of the interactions rewrite.
comment:9 Changed 13 years ago by
Priority: | blocker → critical |
---|
comment:10 Changed 13 years ago by
Priority: | critical → major |
---|
comment:11 Changed 11 years ago by
Milestone: | 1.next → 2.0.0 |
---|---|
Status: | assigned → open |
comment:12 Changed 8 years ago by
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.
Fixed in r856.