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

on change event get items, Not dragged items data #66

Open
xtcel opened this issue Jan 13, 2020 · 2 comments
Open

on change event get items, Not dragged items data #66

xtcel opened this issue Jan 13, 2020 · 2 comments
Labels

Comments

@xtcel
Copy link

xtcel commented Jan 13, 2020

groups: [
        {
          id: 1,
          name: "To Do",
          items: [
            { id: 1, name: "Item 1", groupId: 1 },
            { id: 2, name: "Item 2", groupId: 1 },
            { id: 3, name: "Item 3", groupId: 1 }
          ]
        },
        {
          id: 2,
          name: "In Progress",
          items: [
            { id: 4, name: "Item 4", groupId: 2 },
            { id: 5, name: "Item 5", groupId: 2 },
            { id: 6, name: "Item 6", groupId: 2 }
          ]
        }]

example drag to do item “ { id: 1, name: "Item 1", groupId: 1 }” to "In Progerss" list,
change evnet get items like this:

[
        {
          id: 1,
          name: "To Do",
          items: [
            { id: 1, name: "Item 1", groupId: 1 },
            { id: 2, name: "Item 2", groupId: 1 },
            { id: 3, name: "Item 3", groupId: 1 }
          ]
        },
        {
          id: 2,
          name: "In Progress",
          items: [
            { id: 1, name: "Item 1", groupId: 1 },
            { id: 4, name: "Item 4", groupId: 2 },
            { id: 5, name: "Item 5", groupId: 2 },
            { id: 6, name: "Item 6", groupId: 2 }
          ]
        }]

I suspect the bug is due to the code :

366  dispatchCustomEvent('added', eventData, this.selections.droptarget);
367  dispatchCustomEvent('removed', eventData, this.selections.owner);

My solution is :

onGroupsChange(items) {
      setTimeout(() => {
        console.log('items: ', JSON.stringify(items));
        // some code
      }, 500);
    },

Is there a better solution?

@xtcel xtcel added the bug label Jan 13, 2020
@wussup
Copy link

wussup commented Jun 5, 2020

Same here, do you have any solution without setTimeout?

@nikolasp
Copy link
Collaborator

nikolasp commented Jun 5, 2020

Hi guys!

My apologies for the slow reply.
I'm really busy, but I'll check this as soon as possible.

Do you mind creating and sharing an example demonstrating this (so I can see template to)?
It will save me some time and I'll be sure what's actually the issue.
Thanks a lot!

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

No branches or pull requests

3 participants