nomcopter/react-mosaic

Add info to window drag source to enable dragging out of the layout

chrisdalke opened this issue · 0 comments

Hello, this is a follow-up to #142 where I talked about dragging into the mosaic layout.

I'd like to also be able to drag the mosaic window out of the layout, into an external drag source. Some background: I have a tabbed application which uses react-mosaic to allow dragging of windows and other tabs into combined layouts. I'd also like to be able to drag a window back out of the layout to split it into its own tab.

In order to do this, two changes would be needed:

  1. the drag source would need to return a drag item that contains the layout path and mosaic key for that window. Right now it seems to only have data used internally:
{
    mosaicId: ...,
    hideTimer: ...
}

Having those fields on the drag item would allow an external drag source to perform some action when the window is dragged out of the layout.

  1. The drag target should be able to return an object with the format { remove: true }, which will tell the window drag source to update the tree with a remove update instead of a drag update.