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() {
3535 }
3636 }
3737
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+ }
4345 }
4446
4547 on ( document , 'keydown' , this . _checkKeyDown ) ;
@@ -48,6 +50,7 @@ function MultiDragPlugin() {
4850 this . defaults = {
4951 selectedClass : 'sortable-selected' ,
5052 multiDragKey : null ,
53+ avoidImplicitDeselect : false ,
5154 setData ( dataTransfer , dragEl ) {
5255 let data = '' ;
5356 if ( multiDragElements . length && multiDragSortable === sortable ) {
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ new Sortable(el, {
2727 multiDrag: true , // Enable the plugin
2828 selectedClass: " sortable-selected" , // Class name for selected item
2929 multiDragKey: null , // Key that must be down for items to be selected
30-
30+ avoidImplicitDeselect: true , // true - if you don't want to deselect items on outside click
31+
3132 // Called when an item is selected
3233 onSelect : function (/** Event*/ evt ) {
3334 evt .item // The selected item
You can’t perform that action at this time.
0 commit comments