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

Add class on current dragging item #108

Open
maicolbruski opened this issue May 15, 2024 · 5 comments
Open

Add class on current dragging item #108

maicolbruski opened this issue May 15, 2024 · 5 comments

Comments

@maicolbruski
Copy link

Hi

It's possible to add class on current dragging item (the ghost item)?

image

fro change this:

image

Tks.

@phphe
Copy link
Owner

phphe commented May 16, 2024

no, it is a image. use HTML Drag and Drop API's setDragImage method to custom drag image in ondragstart, check: https://hetree.phphe.com/v2/api#ondragstart

@maicolbruski
Copy link
Author

Hello, understood, one more question: Can I get the content of current element, for populate the div.innerText with name that element contains

In this case of image: React
...
div.innerText = 'React'

Tks.

@phphe
Copy link
Owner

phphe commented May 17, 2024

ondragstart: (event) => event.target

@maicolbruski
Copy link
Author

I already try this, but event.target return the tree, and not de current element only.

console.log(event.target)

image

@phphe
Copy link
Owner

phphe commented May 20, 2024

try add different class to each node, and get drag element by the class

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