Function freya_elements::elements::onfiledrop

source ·
pub fn onfiledrop<E: EventReturn<T>, T>(
    _f: impl FnMut(Event<FileData>) -> E + 'static
) -> Attribute
Expand description

The filedrop event fires when the user drops a file over the element.

Event Data: FileData

§Example

fn app() -> Element {
    rsx!(
        rect {
            width: "100%",
            height: "100%",
            background: "black",
            onfiledrop: |e| println!("File dropped: {e:?}")
        }
    )
}