Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested data structure will not return relatedContext using onMove for the first drag operation? #419

Closed
jonog94 opened this issue Jun 19, 2018 · 4 comments

Comments

@jonog94
Copy link

jonog94 commented Jun 19, 2018

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.

@AdrianwithaW
Copy link

Also experiencing this problem!

@David-Desmaisons
Copy link
Member

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

@frck006
Copy link

frck006 commented Dec 31, 2019

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;
    },

@ddenev
Copy link

ddenev commented Mar 5, 2020

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants