bevacqua / dragula

:ok_hand: Drag and drop so simple it hurts
https://bevacqua.github.io/dragula/
MIT License
21.89k stars 1.97k forks source link

How to revert back after after drop if condition not matched #677

Open shivanigajewar2018 opened 3 years ago

shivanigajewar2018 commented 3 years ago

Please check attached file

dragula.zip

m/bevacqua/dragula/blob/master/.github/contributing.markdown

Lucase84 commented 3 years ago

This works perfectly for me:

.on('drop', function (el, target, source) {
    if (CONDITION) {
        $(el).remove();
        $(source).append(el);
    }
}