#5863 closed bug (notabug)
Odd behavior when calling cancel in sortable's start event
Reported by: | pboyd | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | ui.sortable | Version: | 1.8.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I was trying to prevent a list item from being moved, so I called cancel() inside the start event, like this:
$("ol").sortable({ start: function(event, ui) { if (ui.item.hasClass('nodrag')) { $(this).cancel(); } } });
This keeps the item from being moved, but a large number of list items are inserted below the item that the user tries to move. In the attached HTML file, try moving the second item you'll see what I mean.
I get this behavior in Firefox 3.6 and Chrome (haven't tried any other browsers).
Attachments (1)
Change History (4)
Changed 13 years ago by
Attachment: | sortable_cancel_problem.html added |
---|
comment:1 Changed 13 years ago by
Err... this was just me being stupid.. my apologies.
$(this).cancel();
should have been:
$(this).sortable('cancel');
(Which then fails for some other reason, but that's probably me mis-using start).
Sorry for the spam, please disregard this ticket.
comment:2 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Move the second item in the list to see the problem.