From 676134128d5203dd888b6e089f316107d02c9220 Mon Sep 17 00:00:00 2001 From: why520crazy Date: Tue, 10 Nov 2015 11:13:09 +0800 Subject: [PATCH 1/2] don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group. --- Sortable.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sortable.js b/Sortable.js index f4ac38d..dbbcc7c 100644 --- a/Sortable.js +++ b/Sortable.js @@ -258,8 +258,10 @@ target = (touch || evt).target, originalTarget = target, filter = options.filter; - - + // don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group. + if(dragEl){ + return; + } if (type === 'mousedown' && evt.button !== 0 || options.disabled) { return; // only left button or enabled } From f4f7051750ad1ec61dfb6a395fb7e52db77c6c43 Mon Sep 17 00:00:00 2001 From: why520crazy Date: Wed, 9 Dec 2015 11:28:57 +0800 Subject: [PATCH 2/2] meet style --- Sortable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sortable.js b/Sortable.js index dbbcc7c..adc6bbd 100644 --- a/Sortable.js +++ b/Sortable.js @@ -259,7 +259,7 @@ originalTarget = target, filter = options.filter; // don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group. - if(dragEl){ + if (dragEl) { return; } if (type === 'mousedown' && evt.button !== 0 || options.disabled) {