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

feat: support setting drop effect for drop targets. #3531

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

josephdangerstewart
Copy link

Adds an option to the useDrop hook to set the drop effect based on drop target and updates the documentation to reflect the changes.

Since there can be multiple sources of truth for what the drop effect should be (drag source options, drop target options, and alt key being pressed), my PR uses the following precedence (but I'm happy to change it if the reviewer prefers something different)

  1. Use dropEffect from drag source
  2. Use dropEffect from the most deeply nested drop target
  3. If the alt key is pressed, then use "copy"
  4. Default to "move"

Resolves: #3529

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

Successfully merging this pull request may close these issues.

How to change drag dropEffect based on drop targets?
1 participant