File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,13 @@ function MultiDragPlugin() {
35
35
}
36
36
}
37
37
38
- if ( sortable . options . supportPointer ) {
39
- on ( document , 'pointerup' , this . _deselectMultiDrag ) ;
40
- } else {
41
- on ( document , 'mouseup' , this . _deselectMultiDrag ) ;
42
- on ( document , 'touchend' , this . _deselectMultiDrag ) ;
38
+ if ( ! sortable . options . avoidImplicitDeselect ) {
39
+ if ( sortable . options . supportPointer ) {
40
+ on ( document , 'pointerup' , this . _deselectMultiDrag ) ;
41
+ } else {
42
+ on ( document , 'mouseup' , this . _deselectMultiDrag ) ;
43
+ on ( document , 'touchend' , this . _deselectMultiDrag ) ;
44
+ }
43
45
}
44
46
45
47
on ( document , 'keydown' , this . _checkKeyDown ) ;
@@ -48,6 +50,7 @@ function MultiDragPlugin() {
48
50
this . defaults = {
49
51
selectedClass : 'sortable-selected' ,
50
52
multiDragKey : null ,
53
+ avoidImplicitDeselect : false ,
51
54
setData ( dataTransfer , dragEl ) {
52
55
let data = '' ;
53
56
if ( multiDragElements . length && multiDragSortable === sortable ) {
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ new Sortable(el, {
27
27
multiDrag: true , // Enable the plugin
28
28
selectedClass: " sortable-selected" , // Class name for selected item
29
29
multiDragKey: null , // Key that must be down for items to be selected
30
-
30
+ avoidImplicitDeselect: false , // true - if you don't want to deselect items on outside click
31
+
31
32
// Called when an item is selected
32
33
onSelect : function (/** Event*/ evt ) {
33
34
evt .item // The selected item
You can’t perform that action at this time.
0 commit comments