Open wooden-worm opened 3 months ago
I had the same problem not long ago. Indeed the problem is that you have to preventDefaults() on the on ondragover event of the target. In Dioxus you do this be setting an attribute on the rsx Element instead of calling a function on the event.
div {
prevent_default: "ondragover",
}
Last time I checked i didn't find any documentation for this and found out about this attribute after reading a code snipped in a random issue. It seems to be documented now: Event Handlers
I had the same problem not long ago. Indeed the problem is that you have to preventDefaults() on the on ondragover event of the target. In Dioxus you do this be setting an attribute on the rsx Element instead of calling a function on the event.
div { prevent_default: "ondragover", }
Last time I checked i didn't find any documentation for this and found out about this attribute after reading a code snipped in a random issue. It seems to be documented now: Event Handlers
Thank you, that works for me 👍
Problem
I'm trying to implement drag & drop on the web, but
ondrop
is not getting called.I think I need to call
event.preventDefault()
on the JS event (not the Rust event). However, it's not clear to me how to do so.Expected behavior
ondrop
should be called.Environment:
Questionnaire