Skip to content

feat(cdkDragDrop): A way to block the origin list during a dragging action #14863

Closed
@julianobrasil

Description

@julianobrasil

Please describe the feature you would like to request.

A way to disable drag-and-drop on the origin list after a dragging has started and, afterward, restore its capability after the drop action

What is the use-case or motivation for this proposal?

I have a bunch of lists. One of them works as a source of resources (each element represents a resource type). The other lists work as the consumers of the resources.

In the source list, each element shows the total number of available resources of the type it represents. I decrement this number whenever a resource is dragged and dropped on one of the consumer lists.

The problems is that I should be able to drag elements from/to the source. But I do not want to see a placeholder in either of these situations (despite the fact that I'd like to still be able to drag-and-drop elements from/to it):

1 - when I am dropping an element to it, I do not want to show any placeholder
2 - when I am dragging an element from it and hover the dragged element over it again, I do not want to see any placeholder (which seems to be the default behavior).

Is there anything else we should know?

I kind of worked it around by hiding the list while dragging (and showing a not draggable clone of it), and forbidding the dropping from other lists to it.

There are some possible similarities to #14539 (the item 2 above could be solved if I could set a placeholder to none in the drop list with some kind of @Input() or set a different placeholder depending on the origin of the element being dropped on it). The lists, in this use case, have different shapes.

Metadata

Metadata

Assignees

Labels

featureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions