-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to drag a item between two ReactGridLayout #792
Comments
I understand why you want this (I do too) but it is because I am using the control as something other than a layout control. The feature you are looking for is available in react-beautiful-dnd which allows lists and dragging between those lists. I'm considering moving to that control for what I am doing that doesn't involve layout and using this control for layout as it was intended :-) |
@fairps thankyou, but react-beautiful-dnd is only for list , the ReadMe.md say
so I will try to use react-dnd to ceate a wheel project just like GridLayout. |
This issue is really a duplicate of #688... I've looked at this much further after my last comment... maybe PR #684 that is waiting to be merged might allow react-grid-layout to act as a drop target for incoming objects. Don't underestimate the amount of work that has been done in react-grid-layout and react-beautiful-dnd beyond what react-dnd is offering out of the box... both are using react-motion to provide a drag experience that feels natural. For me, the only difference right now between react-grid-layout and react-beautiful-dnd with a series of side by side lists is the inability to resize elements and have them extend across those columns (lists). If PR #684 will allow the drop target, then I will use react-beautiful-dnd to create a toolbox of sorts and drag items from it into my primary react-grid-layout... or at least that's how I am leaning at the moment. |
@fairps Yeah, I had used react-dnd successfully to complete card grid layout and move card to other list, see this in my drag gif. |
@SunXinFei got a sample for that? About to do that myself! |
@martinwebrant react-grid-layout-between, you can view this code, but sorry I did not have a sample for that, maybe complete the project,free time will commit a sample templete. |
@SunXinFei thanks for posting that link. I Really appreciate it. |
@fairps ,recently I have been optimizing and modifying this code ,here is the react-grid-layout-between, it can be horizontal or vertical, |
@SunXinFei Hey, I've run into some trouble starting your code. Does it still work? |
@blizzerand oh! I create the project react-grid-layout-between. you can run it, maybe it can help you . when i'm not busy , i will create the component.Live demo: http://demo.sunxinfei.com/ |
@SunXinFei Thank you! Works perfectly well :) |
@blizzerand yeah, just a moment ago, I added the logic about switch Compaction Type: horizontal || vertical. |
@SunXinFei Have you completed the awesome functionality?
|
you can view this project https://github.com/SunXinFei/react-grid-layout-between |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 7 days |
Not stale just ignored |
Hi Good morning all, please I want to achieve this http://mmoinuddin.com/assets/img/grid-layout-dnd.gif, the goal is to extend the algorithm, so a module can move within the layout container. The module can't move outside of the top, right, and left edges of the layout container. The bottom edge behaves differently. When a module is moved downwards beyond the bottom edge, the bottom edge should also move downwards to extend the height of the layout container. Also, Module objects cannot overlap each other. So how can I achieve that using React-typescript |
I solved it by creating two grids with isDraggable to false and followed the "Drag from outside" example. |
@spedy please can I see the code of how you implemented it . |
<ReactGridLayout layout={this.state.layout1}> {this.generateDOM()} </ReactGridLayout> <ReactGridLayout layout={this.state.layout2} > {this.generateDOM()} </ReactGridLayout>
anyone resolve this question?
The text was updated successfully, but these errors were encountered: