Open solarcellsky opened 1 week ago
Name | Link |
---|---|
Latest commit | 66200f0060bf58ec003f8595913bf36f920f2455 |
Latest deploy log | https://app.netlify.com/sites/vue-draggable-plus/deploys/667d406691c6bb0008f339a5 |
Deploy Preview | https://deploy-preview-150--vue-draggable-plus.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
I modified onAdd and onRemove function, add an attribute 'existed' for element in onAdd function. In onRemove function check this attribute, if existed the element will not moved to 'to' target and will kept in 'from' target.
Are you dealing with a case where an element needs to exist in multiple groups simultaneously?
Are you dealing with a case where an element needs to exist in multiple groups simultaneously?
Yes. I have been working on a module about scheduling recently, which is divided into different shifts and shifts, and these plans may be repeated, but the dates are different, and most of the personnel say that the time is fixed, but they are on duty at different times and shifts, so there must be duplication, and my need is to adjust by dragging the list of these personnel. The whole schedule plan, this is my practical application scenario.
Thank you for your PR
I don't think this is an issue that needs to be handled by vue-draggable-plus, because if my array elements are primitive types, for example:
const list1 = [1, 2, 3, 4];
const list2 = [2, 3, 4, 5];
Then it is very clear that 2, 3, and 4 are duplicates. However, dragging between groups is allowed. You can try using filter
to disable the dragging of elements that already exist in list2
, instead of prohibiting the dragging of identical elements between multiple lists.
There is a screen record to show how i use vue-draggable-plus. Maybe my needs are not common. Thank you for your patient reply.
Sometimes we need to check the element existed when move element between groups. So i made this PR.