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 request: ability to tell when an item is over another container #5

Open
adam-lynch opened this issue Apr 14, 2017 · 2 comments

Comments

@adam-lynch
Copy link
Contributor

Think of the "multiple containers + handle" example. I need to know when the element currently being dragged is over another container (i.e. when the ghost element is shown in that container) so I can add a class to it and style it differently.

You could emit an event (and or add a class) when it moves over it and moves out (but you'd have to add the logic to figure that out). You could alternatively emit an event when the element is being dragged (i.e. it would be emitted a lot of times for one drag) and leave it up to the user to do the rest in the callback (although they might implement it inefficiently).

@supraniti
Copy link
Owner

Yep. I can see the benefit in that.
Any reason to prefer emitting an event over adding a class?

@adam-lynch
Copy link
Contributor Author

For me, no I don't think so. But maybe someone might have their own use case that means they need more control, I don't know. I think you'd need at least some kind of drag event anyway because people might want to handle when an element is dragged over an arbitrary element (which isn't in a container) like a huge "delete" button or something.

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

No branches or pull requests

2 participants