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

[bug report] dropModel not updating correctly, only from second drop on #974

Open
5 tasks done
r-sw-eet opened this issue Oct 22, 2019 · 3 comments
Open
5 tasks done

Comments

@r-sw-eet
Copy link

r-sw-eet commented Oct 22, 2019

REQUIRED: Before filing a bug report

Describe the bug (required)

I have two arrays, the one on the right is supposed to be a list of prototypes. When I drop them into the left list/div, the new object is shown, the id is incremented. So far so good. Now I want to read out the elements of the array.
With dragulaService.drop the correct number of elements are shown.
With dragulaService.dropModel the number of elements is only updated when I drop a second time from right to left, or if I sort (incl. drop) in the left list.
I suppose that is not the expected behaviour?

To Reproduce (required)

Steps to reproduce the behavior:
[stackblitz]: https://stackblitz.com/edit/angular-hdam1p
(Un-)Comment the dragulaService.dropModel or the dragulaService.drop.
But if you leave them both in place, the problematic behaviour shown as well.

Screenshots (optional)

Versions (required)

Please state which versions of the following packages you have installed:

  • @angular/core: [e.g. 8.2.11]
  • ng2-dragula: [e.g. 2.1.1]

Browsers affected (optional)

Additional context (optional)

@r-sw-eet
Copy link
Author

fyi: for some reason, stackblitz says copy is not a known property of dragulaOptions, but it works anyway..

@sigod
Copy link

sigod commented Jan 23, 2020

Same issue here. And I'm not even subscribing to drop.

For my situation, it's better to use [(dragulaModel)] to define the target array and execute dropModel's logic on dragend event.

@RakeshMaddala
Copy link

This is looks like a issue similar to - #1082

Service is not provided as singleton

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

3 participants