Opened 7 years ago

Closed 7 years ago

#8897 closed bug (invalid)

Dragging items in a 'sortable' does not drag the right objects.

Reported by: raphael.mankin Owned by: raphael.mankin
Priority: minor Milestone: 1.10.0
Component: ui.sortable Version: 1.9.2
Keywords: Cc:
Blocked by: Blocking:

Description

I have copied the example from the download site that enable ne to drag objects between a pair of lists. At first glance this works as advertised. Then I soon discovered three bugs:

  1. When dragging from list A to list B it appears to work. When dragging back from list B to list A it tends to drag back also the last object copied in the other direction.

2, Some objects are not draggable. I can find no reason for this.

  1. If you drag *all* the items from one list to the other, the whole thing falls apart.

Environment is Firefox 17.0.1 on Ubuntu 12.0.4

The example code ,slightly modified so that once *see* empty lists is below.

<html> <head> <title>jquery test</title> <script src="jquery-ui-1.9.2.customjs/jquery-1.8.3.js"></script> <script src="jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.js"></script> <script type='text/javascript'> Case A: Move within the same list Case B: Move from one list to another

$(function() {

$('#sort1').sortable({

stop: function(event, ui) {

Called in case A and B (!!sender == false in both)

/* if(!ui.sender) alert("sender not set"); else alert("sender is set"); */

}, receive: function(event, ui) {

Called only in case B (with !!sender == true) alert("Moved from another list"); event.preventDefault();

}, connectWith: ".sortable", appendTo: 'body'

}).disableSelection(); $('#sort2').sortable({

stop: function(event, ui) {

if(!ui.sender) alert("sender not set"); else alert("sender is set");

}, receive: function(event, ui) {

Called only in case B (with !!sender == true) alert("Moved from another list"); event.preventDefault();

}, connectWith: ".sortable", appendTo: 'body'

}).disableSelection();

}); </script> <link rel="stylesheet" type="text/css" href="jQuery/themes/blue/style.css" /> </head> <body> <Table border='1'>

<tr><th> List 1</th> <th></th> <th>List 2</th> </tr> <tr><td> <ul id='sort1' class="sortable" style='border:1px solid red;min-height:20px; max-width:100px'>

<li>item 1</li> <li>item 2</li> <li>item 3</li>

</ul>

</td><td>&nbsp;&nbsp;</td><td>

<ul id='sort2' class="sortable" style='border:1px solid red;min-height:20px; max-width:100px'>

<li>item 4</li> <li>item 5</li> <li>item 6</li>

</ul>

</td></tr> </table> </body> </html>

Change History (2)

comment:1 Changed 7 years ago by tj.vantoll

Owner: set to raphael.mankin
Status: newpending

Hi raphael.mankin, thanks for taking the time to contribute to the jQuery UI project. We're going to need a reduced test case using the latest version of jQuery UI in order to assess your ticket. You can use this to get started - http://jsfiddle.net/tj_vantoll/VqKtR/. Try to remove all code that's extraneous to showing the issues that you are describing.

Thanks.

comment:2 Changed 7 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.