Closed sjeannin closed 7 years ago
At first glance your code looks good to me, should be working.
You dont need to specify both accepts and canBeAcceped in your scenario. Difference between them is that accepts is executed when item is being dropped in my container and canBeAccepted is executed when item from my container is dropped somewhere else. So accepts is suitable for filtering whan can be dropped in my container and canBeAccepted is suitable for filtering where items from my container can be dropped.
Please be so kind and save my time by reproducing your scenario somewhere I can examine the code..for example you can fork this codepen as start point. Thanks
Here's the updated codepen
You will be able to check that you can drag element from "test-1" to "test-3" even if there is already an element in test-3.
Thank you so much for investigating :)
Ok it seems to be bug :/ I will fix it soon..
I have found the bug, so the fix will be soon released ;)
You rock! Thank you for your time :)
Just released v4.4.6 including the fix. I have made some minor edits to your code here. Thank you for your cooperation! Happy coding! :)
Thanks a lot and have a great weekend :)
Hi there!
So I've read through the docs and I can't find a way to set the max number of elements in all containers, especially when the containers are injected via a directive and depend on different scopes.
My problem is: when dropping an element where the container is supposedly full, sometimes it will be accepted and sometimes rejected, although it should always be rejected.
I use a service to initialize all containers independently and they do share the same type of models and behavior :
Therefore, my anchors/notes have the following structure in my factory:
This is how I initialize my service for all my containers during the directive link:
The dragularService is the same for all containers, since it's used only once in the service that also handles the factory.
Thanks! ~SJ