-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Is it possible to swap elements between two lists on a drop? #911
Comments
I struggling to understand what you are trying to achieve. Could you please provide some more information / diagrams? |
I simply want to drag a list item on another list item and have them swap positions instead of the item just being dropped in place. I could do diagrams if more information is needed, but I'm just looking to swap items instead of insert. |
You can do what you like in your |
I'm going to close this so I can stop cluttering your issues and I don't have time to write a test implementation now; thank you for the input :) |
@alexreardon You can indeed implement the swap in the |
Seems like a more generic feature request should be created regarding animations on custom element movement if you think it's a good idea? I don't think my original request should be opened up as I don't think it reads well enough to be understood and is quite a narrow requirement. |
Did this ever get turned into a generic feature request? I too am looking for this functionality. In my application, I have two lists of items to visualize a knapsack 0/1 problem. The left side of the list represents items which are not in the knapsack. The right side of the list represents items that are in the knapsack. When a user clicks on an item in the left, my application calculates:
(In reality both of these would be pre-calculated for every selection option) As the user drags the selected item from the left and drags to the right, the item(s) that need to be popped out slide to the left. The animation of the right items should correspond with the inverse of the dragging motion of the user. So, if the user drags 2cm to the right, the item(s) being popped from the right list move 2cm to the left. |
Potentially this could be satisfied by #162 |
I'm looking to create a drag and drop style interaction where elements are dragged to other elements which then swaps them. The layout could be achieved by two lists of two elements each, with each list always containing two elements; but I can't see anywhere which suggests this would or wouldn't be supported.
Do you think this is achievable with react-beautiful-dnd?
And apologies for using your issues for this kind of question, I didn't see a link to an alternative discussion board for casual questions.
The text was updated successfully, but these errors were encountered: