Can you explain this weird behavior when dragging items into nested sorts?

I have the following setup:

  • A sortable list in which one of them <li>has a table with lists in each cell.
  • All lists are sorted with each other.
  • Draggable items that can be added to any sortable

Problem. When adding a dragged item ("drag 1", "drag 2", "drag 3") to one of the lists in the horizontal lists (list table), it duplicates the dragged when deleted. Sometimes it creates both copies in the same list or one in the list of items and one in the list of columns.

Here is a demo: http://jsfiddle.net/MQTgA/

Question: How to prevent the creation of the second element when deleting the draggable?

The UPDATE . When you change the class names of horizontal lists to something else ("hlist") and omit the new class name from the "connectToSortable" ("ul.hlist") option, it no longer discards two copies and still allows you to delete an item in any list. This does not seem right. In addition, when you try to drop an item into a horizontal list, instead of the main list, it seems very touching (it will not create a good user experience). Thoughts?

Updated demo: http://jsfiddle.net/MQTgA/3/

+3
source share
2 answers

, , . , , , , .

, , :

http://jsfiddle.net/MQTgA/5/

0

, (, 1 - X) , . , , . , , .


EDIT: , . , , , jQuery, , . , .

0

Source: https://habr.com/ru/post/1783447/


All Articles