Opened 5 years ago

Closed 5 years ago

#15076 closed bug

sortable cancel but remove sort item.

Reported by: vee w, Owned by: vee w,
Priority: minor Milestone: none
Component: ui.sortable Version: 1.11.3
Keywords: Cc:
Blocked by: Blocking:

Description

    $('.posts_page_rd-postorder_reorder-posts tbody').sortable({
        handle: '.reorder-handle',
        helper: 'clone',
        placeholder: 'ui-placeholder',
        revert: true,
        sort: function(event, ui) {
            if ($(this).hasClass('cancel')) {
                $(this).sortable('cancel');
            }
        },
        start: function(event, ui) {
            // fixed height for table row.
        },
        update: function(event, ui) {
            // on stopped sorting and position has changed.
        }
    });

This is my code. I add keypress listening on press escape key to add cancel class to the sortable. And in start: method if there is cancel class then cancel sorting.
Everything seems to working fine but when it cancelled the item were removed.

Change History (3)

comment:1 Changed 5 years ago by Scott González

Owner: set to vee w,
Status: newpending

As requested in the red box, please provide a reduced test case showing the problem.

comment:2 Changed 5 years ago by Scott González

Component: ui.coreui.sortable

comment:3 Changed 5 years ago by trac

Status: pendingclosed

This ticket was closed automatically by the system. It was previously set to a Pending status and hasn't been updated within 14 days.

Note: See TracTickets for help on using tickets.