Skip to content
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

destination draggableId in onDragEnd #2103

Open
jroru opened this issue Feb 26, 2021 · 2 comments
Open

destination draggableId in onDragEnd #2103

jroru opened this issue Feb 26, 2021 · 2 comments

Comments

@jroru
Copy link

jroru commented Feb 26, 2021

Description

I would like to be able to read the draggableId of the destination in the onDragEnd handler, just like is currently possible with the draggableId of the source

e.g.

const onDragEnd = ({ source, destination, draggableId, destinationDraggableId }: DropResult) => {
    console.log(draggableId); // "a"
    console.log(destinationDraggableId); // "b"
};
@goamn
Copy link

goamn commented Sep 30, 2021

I think this is very useful. I need this right now. I tried creating two Droppable's in order to get both source and destination DroppableId, however now I have the issue of an "extra index" because both Droppable's not have a {provided.placeholder}, also they are both in effect at the same time. These problems would be solved if we also get the draggableId of the destination and not just the index.

@totaldict
Copy link

Unfortunately, the draggableId is only contained in DragUpdate.combine, but I would like to get it in DragUpdate.destination as well. Now there is only an index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants