Opened 13 years ago

Closed 13 years ago

Last modified 10 years ago

#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)

sortable_cancel_problem.html (1.0 KB) - added by pboyd 13 years ago.
Move the second item in the list to see the problem.

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by pboyd

Move the second item in the list to see the problem.

comment:1 Changed 13 years ago by pboyd

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 Scott González

Resolution: invalid
Status: newclosed

comment:3 Changed 10 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.