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

Dynamic drag image during drag #30

Open
ddenev opened this issue Jun 7, 2020 · 3 comments
Open

Dynamic drag image during drag #30

ddenev opened this issue Jun 7, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@ddenev
Copy link

ddenev commented Jun 7, 2020

Hi,

Is is possible to have a dynamic drag image (one that can be changed during the drag operation)?

Here is an example of what I mean - https://marcojakob.github.io/dart-dnd/custom_avatar/

Best regards.

@rlemaigre
Copy link
Owner

That is something I had not envisioned. The drag image may only be defined using a slot on Drop components. But I suppose you could use the dragenter, dragleave and dragover events to do this yourself, or use the computed provided by the DragAwareMixin. But it isn't convenient.

@rlemaigre rlemaigre added the enhancement New feature or request label Jun 8, 2020
@ddenev
Copy link
Author

ddenev commented Jun 8, 2020

But I suppose you could use the dragenter, dragleave and dragover events to do this yourself

Yes but the idea here is a little bit different - if you noticed in the example above, the image changes during the drag move (I guess based on distance from source) and does not depend on the drop zone.

So I guess this could be a nice enhancement indeed.

@rlemaigre
Copy link
Owner

No what I mean is to create the drag images yourself, animate them and swap between them, just like I do. But it's not convenient.

What I should do is allowing several drag-image slots like drag-image:a, drag-image:b, and so on...and allow to user to supply a function that returns which one should be currently in use (a or b or...).

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

No branches or pull requests

2 participants