CDK drag and drop: add ability to drag item in copy mode without changing initial list #17638
Labels
area: cdk/drag-drop
feature
This issue represents a new feature or feature request rather than a bug or bug fix
needs triage
This issue needs to be triaged by the team
Feature Description
Hi, guys. I would like to propose a small enhancement for copying items from list to list. Currently copying works great, but after item is dragged to another list, initial list removes it from itself and bind it to root element (body tag in my case). But way that I see more logical is to add boolean @input (let's name it cdkDropListCopyMode) to drop list directive to make it possible to choose conditionally whether you want to move items and leave default behavior or to copy items and avoid removing item from initial list.
Use Case
In my project I have list of items (initial list) and sublist constructor (destination list). Initial list is fluid, and if one item from this list is removed, items after this item seek to fill free place one by one, and after you release item it appears in initial list again, and this flickering looks odd.
P.S. I saw your comment in source code that you move the element out at the end of the body and make it hidden, because keeping it in place will throw off the consumer's
:last-child
selectors, but I believe that it shouldn't be a problem as well. Also I've been tracking #13100 until it was automatically closed, but this behavior is still not fixed. If you need help with it, just let me know.The text was updated successfully, but these errors were encountered: