Skip to content

Limit event to one for nested lists #1785

Open
@ap-prog

Description

@ap-prog

With this code on nested lists

let options = {
    group: {
        name : 'items'
    },
    onSort: function() {
      console.log('sorted');
    }
};

Sortable.create(document.getElementById('items'), options);
Sortable.create(document.getElementById('items-1'), options);
Sortable.create(document.getElementById('items-2'), options);

Moving an item from within a nested list into the parent list triggers the onSort event twice (I guess, once for the nested list and once for the parent list). I'm using the onSort event to call other functions and getting two events almost simultaneously is causing issues.

Is there way to get only one event when sorting has completed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs investigationtodo list of investigationquestionquestions from the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions