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

Feature/432 wildcard drop target #440

Closed

Conversation

froatsnook
Copy link
Collaborator

New feature for #432

There's a hard dependency on react-dnd/dnd-core#31 since I'm using the new isValidSourceType and isValidTargetType

@darthtrevino
Copy link
Member

I'm going to close this out for now, it may make sense to have a predicate function here at some point, but I think using rest/spread to splat an array out would suffice.

@darthtrevino darthtrevino reopened this Feb 8, 2017
@enterthekiwi
Copy link

is this going to be merged? id very much like to use this. have a dnd component that can be used in many contexts and shouldn't have to know exactly which types it can accept

@darthtrevino
Copy link
Member

darthtrevino commented Feb 15, 2017

Probably not as-is. The original PR that @froatsnook submitted was two separate PRs across projects. Since we've restructured to a monorepo the PR would need to be resubmitted. I'd like to think through this feature request a bit more. I'm not sure a wildcard is the most friendly way to approach this. A predicate function may make sense e.g. @DropTarget(e => true), and maybe implicitly globally allowing drops would make sense e.g. @DropTarget // no args, accepts everything

@enterthekiwi
Copy link

okay cool, thank you. i agree w/ the predicate function, but there should definitely be some solution to this problem so that dTargets don't have to know every single type dSource they need to respond to in advance.. it really makes it harder to build reusable dnd components, and i see no advantage since you can simply check the dragged item type in the hover/drop methods before doing anything. will keep an eye out for it, thanks for the work you've done on this library 😄

@crispy-invention
Copy link

@froatsnook this is an old PR. We have canDrop() which can be used for similar purpose. Can you close this PR?

@stale
Copy link

stale bot commented Jul 18, 2019

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.

@stale stale bot added the wontfix label Jul 18, 2019
@stale stale bot closed this Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants