SortableJS / Sortable

Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.
https://sortablejs.github.io/Sortable/
MIT License
29.78k stars 3.7k forks source link

Disable on Filter #1078

Open levonmanucharian opened 7 years ago

levonmanucharian commented 7 years ago

Is there any way to disable the Sortable within onFilter function? I'd like it to stop working when the user clicks on any of the filtered lists elements that are inside the sortable block. Not much luck with any combination I tried, the Sortable.option("disabled", true); does not work in this case. Thanks in advance.

Sortable.create(sortableElement, { //handle: '.draggable', // Restricts sort start click/touch to the specified element filter: 'p, .text, h1, h2, h3, h4, h5, h6', draggable: '.draggable', // Specifies which items inside the element should be sortable onFilter: function (/*Event/evt) { //Sortable.option("disabled", true); } });

owen-m1 commented 5 years ago

Why would that not work?