jquery-ui icon indicating copy to clipboard operation
jquery-ui copied to clipboard

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

Open kghandi opened this issue 11 months ago • 3 comments

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'); } });

kghandi avatar Jan 08 '25 20:01 kghandi

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: kghandi (af50299fb12de9527f84e07b884f49436bec9fad)

Sounds reasonable to me and the changes are not that big, so I'm fine with integrating this when all requirements are met.

fnagel avatar Jan 15 '25 14:01 fnagel

I have fixed the code style as requested. I have also created pull request for api documentation https://github.com/jquery/api.jqueryui.com/pull/369

kghandi avatar Jan 28 '25 16:01 kghandi