Closed kwhur closed 8 months ago
Let me make it clear that your A component uses sortable and B component uses draggable-plus. Do you need to drag the elements in B component to A component?
Yes, A is using Sortable and B is using draggable-plus. A represents a folder tree, while B represents a file list. I am implementing a feature to drag file items from B and drop them into the folder tree of A to move the files.
In fact, if you are using "draggable-plus," you need to add an element to the two-way bound list when dragging to the target list. It's possible that the element was not added to the list when the drag ended because it wasn't retrieved at that point. This could result in a failed drag operation because when dragging, a bound data is added to the drag target element. However, for security reasons, I've set this bound key as a Symbol
type, so it cannot be set from the outside. Would you consider using both components "draggable-plus" and "draggable" to solve this issue?
Related code: https://github.com/Alfred-Skyblue/vue-draggable-plus/blob/bcc29b3f36ea33321aaa446b4d3a67bdc19d5865/src/useDraggable.ts#L43
Wow, your response is incredibly quick. Thank you so much. I'll give it a try immediately.
I've replaced Sortable with Draggable-plus and it resolved the issue. I'm truly grateful for the excellent library and your rapid support.
There are two list components, A and B. Component B is utilizing draggable-plus, and they are not part of the same group. However, there are cases where they need to process list items from each other. Items can be dragged from component A and dropped into component B, triggering the onDrop event, and it works fine. However, dragging items from component B to component A is disabled.
When replacing draggable-plus with sortable, the drag-and-drop functionality works as expected. Is this issue related to draggable-plus? If so, what is the solution to enable drag-and-drop from component B to A while using draggable-plus?