vue-nestable icon indicating copy to clipboard operation
vue-nestable copied to clipboard

css classes removed by beforeMove-hook

Open CaptainCannabis opened this issue 4 years ago • 0 comments

I am using two instances of the component with the group/cross-feature.

One is holding hierarchical data (company with teams and members of those) while the other one holds a list of the deleted items from the "tree"-list. If they get deleted, they are added to thats list items. User can drag them back to the tree.

To achieve that, i got to cancel the drop if the user wants to drag a person on everything else than a team-node.

I am doing this in the before-move-hook i set. BUT ... if the user hovers a node which returns false in the hook the component logic removes the classes "nestable-item, nestable-itemx AND is-dragging" from the li nested in the dragged "ol".

Would have excpected that the "is-dragging"-class is removed while the others remain.

That results in an unstyled dragged item (if there is no valid drop-target in the tree list). What to do to fix that?

TreeEdit_github

EDIT: seems to be a problem with my drop-conditions in beforeMount - for the tree-list it seems to be dropped at some point. Got it kind of working right now but i would like to know if there is some way to disable the dropzone for specific parent items but preserve the dropzones below. it seems if i return false in the [0,0] item i cannot drop to [0,0,0] ? So there is no case for dropping allowed for children but not for parent.

TreeEdit_2

CaptainCannabis avatar May 30 '20 13:05 CaptainCannabis