You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DragAndDrop API in its current form is not possible to use.
⚠️ Current behavior
Functions have dubious naming:
DragContainer and DropContainer sound like counterparts but they are not. DragTarget is the current counterpart for DropContainer. Try to use them by their current naming and it doesn't even layout correctly - DragContainer does something to break the component being added to layouts.
DragTarget makes no sense because "target" refers to where you are dropping the thing. Usually we refer to the place where you start the operation as the "drag source".
What DragContaineractually appears to be for is... just drawing the overlay? So maybe a good name would be DragAndDropOverlay or something to that effect.
Next issue is, the MIME type system isn't flexible enough to actually use, real data transfer pretty much lets you have anything you want.
Last issue is major, the current API requires the draggable data to be constructed in order to declare the drag target. You don't want to eagerly instantiate the draggable data for every item in the application. That's how you make an application run out of memory. Instead, there should be some kind of callback to create the draggable data which would be one of the parameters for the drag source.
I also expected some kind of method for consuming the thing when it was dropped but I couldn't find it at all. Actually I'd expect two callbacks. One for the drop target to inform it that some data has been dropped, and another for the drag source to inform it that the data has been dragged out (at the time when the drop happens, though, not as soon as it's picked up, otherwise when the user cancels the drag by hitting Escape, they will find out they have nothing left).
So all up I don't think this library is usable to implement drag and drop, but it does give good, solid examples of how the different bits have to be fit together to make drag and drop work, which is helpful anyway.
✔️ Expected behavior
The library can be used without hassle, the API makes sense and things generally work.
🪜 Steps to reproduce
📷 Screenshots
📱 Tech info
Name of the library:
Library/sample version:
Device/emulator version/model:
OS:
The text was updated successfully, but these errors were encountered:
🐛 Describe the bug
The DragAndDrop API in its current form is not possible to use.
Functions have dubious naming:
DragContainer
andDropContainer
sound like counterparts but they are not.DragTarget
is the current counterpart forDropContainer
. Try to use them by their current naming and it doesn't even layout correctly -DragContainer
does something to break the component being added to layouts.DragTarget
makes no sense because "target" refers to where you are dropping the thing. Usually we refer to the place where you start the operation as the "drag source".DragContainer
actually appears to be for is... just drawing the overlay? So maybe a good name would beDragAndDropOverlay
or something to that effect.Next issue is, the MIME type system isn't flexible enough to actually use, real data transfer pretty much lets you have anything you want.
Last issue is major, the current API requires the draggable data to be constructed in order to declare the drag target. You don't want to eagerly instantiate the draggable data for every item in the application. That's how you make an application run out of memory. Instead, there should be some kind of callback to create the draggable data which would be one of the parameters for the drag source.
I also expected some kind of method for consuming the thing when it was dropped but I couldn't find it at all. Actually I'd expect two callbacks. One for the drop target to inform it that some data has been dropped, and another for the drag source to inform it that the data has been dragged out (at the time when the drop happens, though, not as soon as it's picked up, otherwise when the user cancels the drag by hitting Escape, they will find out they have nothing left).
So all up I don't think this library is usable to implement drag and drop, but it does give good, solid examples of how the different bits have to be fit together to make drag and drop work, which is helpful anyway.
✔️ Expected behavior
The library can be used without hassle, the API makes sense and things generally work.
🪜 Steps to reproduce
📷 Screenshots
📱 Tech info
The text was updated successfully, but these errors were encountered: