vakata / jstree

jquery tree plugin
http://jstree.com
MIT License
5.15k stars 1.38k forks source link

Drag and drop plugin bug when using checkboxes plugin #2476

Closed danipardo closed 3 years ago

danipardo commented 3 years ago

Proof of concept:

https://codepen.io/dani-pardo/pen/wvzVNbm

If you select all checkboxes, and then you move L1A after L1B, you will see that L2 gets moved inside L1, where it should'nt be moved at all (L2 should remain after L1). This only happens when checkboxes are checked. If they are unchecked, the behaviour is correct.

vakata commented 3 years ago

This is because you are actually moving all nodes (when dragging a selected node all selected nodes are moved). Try this option: https://www.jstree.com/api/#/?q=drag_selec&f=$.jstree.defaults.dnd.drag_selection (set it to false).

danipardo commented 3 years ago

Oh, makes sense, I didn't thought about it that way. Thanks! :)