Search and Top Navigation
#7852 closed bug (fixed)
Opened November 09, 2011 12:13AM UTC
Closed November 10, 2011 12:59PM UTC
Last modified November 10, 2011 12:59PM UTC
Droppable event target changes under jQuery 1.7
Reported by: | hunter1728 | Owned by: | |
---|---|---|---|
Priority: | blocker | Milestone: | 1.8.17 |
Component: | ui.droppable | Version: | 1.8.16 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Under 1.6.4 the event target on a droppable drop was the element that the drop occurred to, whereas with 1.7 the event target becomes the element being dropped.
If you drop 'one' onto 'two', under 1.7 the console shows 'one' whereas under 1.6.2 it shows 'two'
(can't seem to do jsfiddle with 1.6.4 as it doesn't seem to do jquery ui)
<!DOCTYPE HTML> <html> <head> <!-- <script src=" http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script> -->
<script src=" http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js" type="text/javascript"></script>
<script src=" http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script>
<script>
function OnDrop(e, ui) {
console.log(e.target.id);
}
$(document).ready(function () {
$("#one").draggable();
$("#two").droppable({ drop: OnDrop });
});
</script>
</head> <body> <div id="one">one</div> <div id="two">two</div> </body> </html>
Attachments (0)
Change History (5)
Changed November 09, 2011 12:14AM UTC by comment:1
Changed November 09, 2011 12:17AM UTC by comment:2
http://jsbin.com/egaked for the other behaviour
Changed November 09, 2011 01:12AM UTC by comment:3
milestone: | 1.9 → 1.8.17 |
---|---|
priority: | minor → blocker |
status: | new → open |
We need to force the target in _trigger because .trigger() no longer does.
Whoops, some inconsistencies there. I tried 1.6.2 and 1.6.4 and it makes no difference.