React-dnd: Add access to dropEffect for dropTarget

Created on 27 Aug 2018  ·  3Comments  ·  Source: react-dnd/react-dnd

Hi there!

Is your feature request related to a problem? Please describe.
I'd like to have an access to the current drop effect in canDrop method within dropTarget decorator spec, so I could disable/enable drop targets according to current effect.

Describe the solution you'd like
I think it'll be nice to have an access to dropEffect from monitor. I prepared draft solution for version 3.0.2 here and don't mind adding this feature to newer versions of the library if needed.

It might be useful in https://github.com/react-dnd/react-dnd/issues/974 as well

wontfix

Most helpful comment

This feature would be super helpful to me. I need to know if the dropped item was moved or copied from within the DropTarget, but from what I've read, you can only access the dropEffect in the DragSource. I have many DropTargets that all lead to different places, so I prefer to handle the onDrop logic in the DropTarget. Maybe I'm using the library incorrectly, but this seems like a valid use case.

All 3 comments

Up! Any comments on that? At least could you please triage it.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This feature would be super helpful to me. I need to know if the dropped item was moved or copied from within the DropTarget, but from what I've read, you can only access the dropEffect in the DragSource. I have many DropTargets that all lead to different places, so I prefer to handle the onDrop logic in the DropTarget. Maybe I'm using the library incorrectly, but this seems like a valid use case.

Was this page helpful?
0 / 5 - 0 ratings