Vue.draggable: Nested data structure will not return relatedContext using onMove for the first drag operation?

Created on 19 Jun 2018  路  4Comments  路  Source: SortableJS/Vue.Draggable

Jsfiddle link

https://jsfiddle.net/v8gme77z/317/

Step by step scenario

I need the relatedContext inside the onMove function, but it seems that the first drag for every nested list to another returns me the list is undefined.

Actual Solution

There is no property list or element property inside relatedContext on the first drag operation within nested draggable components

Expected Solution

I need those properties to be defined on the first drag operation.

Is this issue due to the fact that is has a nested list data structure? As simple one dimensional arrays return the expected value on first drag.

Most helpful comment

Also experiencing this problem!

All 4 comments

Also experiencing this problem!

Could you check using version 2.23.0 solution for issue #603 should fix it.

The problem is always here where we use nested draggable.

The methode "getUnderlyingPotencialDraggableComponent" doesn't return the good component.
I think the problem comes from "vue.$children[0]".
In case of 2 nested draggable, we should use "vue.$children[0].$children[0]"

    getUnderlyingPotencialDraggableComponent({ __vue__: vue }) {
      if (
        !vue ||
        !vue.$options ||
        !isTransitionName(vue.$options._componentTag)
      ) {
        if (
          !("realList" in vue) &&
          vue.$children.length === 1 &&
          "realList" in vue.$children[0]
        )
          return vue.$children[0];

        return vue;
      }
      return vue.$parent;
    },

@David-Desmaisons, the fix you mention above does not fix the OP bug - it is still happening with 2.23.2. I have the same problem - dragging into another element (nesting) produces an (almost) empty relatedContext object - 'list' is undefined, "index" and "element" are missing, "component" is bogus.
Can you please look at this? I understand you are busy (as you explained in my question about whether Vue.Draggable is still maintained) but the last comment above is from 3 months ago and it clearly states that the problem is still on.
Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fedenko picture fedenko  路  3Comments

Stetzon picture Stetzon  路  3Comments

AnnaStuehlmeyer picture AnnaStuehlmeyer  路  3Comments

iou90 picture iou90  路  3Comments

Nrqz picture Nrqz  路  3Comments