Feature request
There is currently no way to set multiple types, or a type wildcard that will accept Draggables of multiple any types. This could be added if there is a valid use case.
I'm building an editor with two possible operations for the main droppable element: You could "MOVE" an existing node or "CREATE" a new one by selecting from a list of possible node types. In addition to that, there is another droppable for deleting nodes that should only accept the "MOVE" type. Is that not a valid use case for accepting multiple draggable types?
Sounds reasonable. You could achieve this today by using the isDropDisabled prop and dynamically updating it based on what is dragging. This would allow you to infinitely complex conditional dropping including multi-types. For now it is my recommended suggestion as it is super flexible. The type prop is mostly for convenience.
Given that we support the isDropDisabled prop I think you could build the logic you are after without too much difficulty
For now the current recommendation is to use the isDropDisabled prop to achieve the affect you are after. Thanks for reaching out @gabiseabra !!
Hello there!
First of all, my words of appreciation for creating such a nice lib. In another project we used ReactDND which is also cool, but too low-level/much boilerplate. This lib is super easy to setup and start using. Good work.
For mentioned straightforward setup and appealing behavior, we are using this lib in another project of ours. And here we have a case where having multiple types supported would very helpful.
So, we have 2 lists of items: 1st is "positive" things and the 2nd - "negative" things. Also there must be the 3rd list for "unimportant" things. It is meant to contain both "positive" and "negative" things inside upon user decision. However it is not allowed to drag-drop items from "positive" thing to "negative" ones and vice a versa, and it should be allowed to re-arrange items within the same list.
So, in this situation it would be very handy to have _POSITIVE_THING_, _NEGATIVE_THING_ types for first 2 lists and for the "unimportant" items: ["POSITIVE_THING", "NEGATIVE_THING"].
Of course it should be possible to implement such behavior using isDropDisabled, but in this case it should be setup for all 3 lists: for positive items list - not to allow negative ones and the opposite for negative items list, and finally for "unimportant" to accept both.
Most helpful comment
Hello there!
First of all, my words of appreciation for creating such a nice lib. In another project we used ReactDND which is also cool, but too low-level/much boilerplate. This lib is super easy to setup and start using. Good work.
For mentioned straightforward setup and appealing behavior, we are using this lib in another project of ours. And here we have a case where having multiple types supported would very helpful.
So, we have 2 lists of items: 1st is "positive" things and the 2nd - "negative" things. Also there must be the 3rd list for "unimportant" things. It is meant to contain both "positive" and "negative" things inside upon user decision. However it is not allowed to drag-drop items from "positive" thing to "negative" ones and vice a versa, and it should be allowed to re-arrange items within the same list.
So, in this situation it would be very handy to have _POSITIVE_THING_, _NEGATIVE_THING_ types for first 2 lists and for the "unimportant" items:
["POSITIVE_THING", "NEGATIVE_THING"].Of course it should be possible to implement such behavior using
isDropDisabled, but in this case it should be setup for all 3 lists: for positive items list - not to allow negative ones and the opposite for negative items list, and finally for "unimportant" to accept both.