Difficulties to implement DragableOverlay #1019
Unanswered
laurent512
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
First of all thank you for the interesting library, It seems to be very powerfull.
As background information, I am a hobbyist dev, with NextJS and Tailwind.
I followed the Sortable part of the documentation without too many difficulties until the DragOverlay chapter at its very end. My questions are related to it :
Why is it said that adding is necessary to render a Drag Overlay ? Without it, I could see as well a drag overlay when I was dragging an element. This is quite confusing to me.
Why "enabling DragOverlay allows to show a preview of where the draggable source will be when dropped" ?
It is not clear to me how these elements are related.
In the last part of Sortable#dragoverlay, the SortableItem.jsx code example contains these lines :
<Item ref={setNodeRef} style={style} {...attributes} {...listeners}> {value} </Item>
, where does{value}
comes from ? What is it supposed to be ?Are there pro/cons for choosing wrapper node or ref forwarding pattern? I am not familiar with any of these. If there is some easy to understand documentation available (inside or outside dnd-kit) I would appreciate it.
After playing around and trying I have these 3 pieces of code
Sadly, it is not similar to some examples I could see in the story book. Example : video
When drop the task, the preview suddenly disapear. Also, could you explain how to customise the preview element ? This is well made in the story book.
Also, I would be interested to know how to smoothly increase the size of the dragged element when it is dragged.
Thank you so much for reading my (many) questions, hope that you will be able to help :) .
Beta Was this translation helpful? Give feedback.
All reactions