Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using a Function as the cancel option instead of a Selector. #2324

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kghandi
Copy link

@kghandi kghandi commented Jan 8, 2025

This is particularly useful when using Sortable on nested lists.
I had a similar issue to that listed in issue 1996. Allowing cancel option to be a function allows me to override the default cancel implementation using a selector with something like:

$('.container', context).sortable({
items: '>.widget',
cancel: function (event) {
return $(event.target).closest('.widget').is('.locked');
}
});

…is is particularly useful when using Sortable on nested lists.
Copy link

CLA Not Signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant