vue-responsive-grid-layout icon indicating copy to clipboard operation
vue-responsive-grid-layout copied to clipboard

Drag a item from one grid to another

Open touchrank-dev opened this issue 1 year ago • 0 comments

By studying the 'drag, drop from outside' example, I tried to implement this feature but failed. At first, the GridItem's move event doesn't expose the clientX and clientY of MouseEvent, so I cannot check whether the item is moved out or not. Second is, GridItem's move and moved events sometimes are not emitted, so I cannot call grid's dragEvent() accordingly. After that, removing a record from layout array during dragging will throw exception ( in hadleDray function of GridItem) because the HtmlElement is removed synchronously. About the behavior of dragging and dropping an item between grids even crossing some grids, I think I should remove the placeholder from source grid when the item dragged is moved out, and append and move a placeholder in the dragging over grid ( and also remove it when mouse out), when the mouse is released in target grid, insert the item. If the mouse is released out of any grids, the source grid will be restored and the removed item will show in its original position.

Perhaps this feature is not a high priority, but I need this and am eager to find how to implement it. Hope I can hear from you. Thank you very much.

touchrank-dev avatar Mar 20 '24 14:03 touchrank-dev