Sortable icon indicating copy to clipboard operation
Sortable copied to clipboard

Drag and drop between two lists with preselect

Open narkoze opened this issue 6 years ago • 3 comments

Problem:

When you drag "Item 2" to "list2" without selection - preselected Item 3 disappears

JSBin/JSFiddle demonstrating the problem:

https://jsbin.com/xuceyiwiki/edit?html,js,output

narkoze avatar Feb 26 '20 08:02 narkoze

It disappears because Sortable will deselect everything if the user starts dragging a deselected item, because its assumed they don't want to use multidrag if they are dragging an unselected item

owen-m1 avatar Feb 27 '20 00:02 owen-m1

It disappears because Sortable will deselect everything if the user starts dragging a deselected item, because its assumed they don't want to use multidrag if they are dragging an unselected item

How can I deselect everything programmatically? I don't want to be able to drag items selected from different lists, it's very confusing for the user when dealing with long trees! thanks

quacrobat avatar Mar 19 '20 16:03 quacrobat

@owen-m1 Perhaps there could be a preventDefault() in the options to disable normal selection in the API?

@quacrobat check out the multidrag docs. This contains util options to programmatically select and deselect items.

waynevanson avatar Apr 16 '20 06:04 waynevanson