JSFiddle - React, Tailwind, and code Playground

by Mottie

HTML

<ul id="sortable">
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
</ul>

JavaScript

$("#sortable").sortable({
    sort: function() {
        if ($(this).hasClass("cancel")) {
            return false;
        }
    }
});

setTimeout(function() {
    $("#sortable").addClass("cancel");
}, 5000);