Sortable icon indicating copy to clipboard operation
Sortable copied to clipboard

With "draggable" option enabled, erratic behavior with items not immediately children of sortable

Open dongfang opened this issue 6 years ago • 2 comments

I use bootstrap's lists, with some div's in lists to group items by a headline. When using SortableJS on such a list, and I drag an item from a group in the list, sortableJS will drag the whole group. This can be reproduced by disabling draggable on line 16 in index.html, and trying to drag an item from the left list to the right.

I want to drag just single items, so I use draggable and add that class to each item (my example as sent).

Problem: Some items in groups can't be dragged. The 2 last items, which are in a group div and are thus not immediate children of

will not drag to the right.

If I change, in _prepareDragStart:

if (target && !dragEl && target.parentNode === el) {

to

if (target && !dragEl) {

then I can drag all.

bugreport.zip

dongfang avatar Aug 31 '20 15:08 dongfang

I've looked at the file you sent and based on configugartion ,it's working as intended.

I'm having trouble understanding your problem. Could you rephrase the problem?

waynevanson avatar Sep 01 '20 03:09 waynevanson

Hi, sorry, I have in the meantime migrated the project to react/react-beutiful-dnd, and I don't have the code any more.

dongfang avatar Dec 21 '20 11:12 dongfang