Skip to content

[feat] get file path in drag events #15861

Description

@Legend-Master

Describe the problem

since we want to flip the default drag handler override in wry by default, it would be easier to switch if we provide some functionalities the web drag and drop is missing, getting the file path is one of them.

Describe the solution you'd like

An API you can call to get the file path like:

document.addEventListener('dragenter', async (ev) => {
  const paths = await getPaths(ev.dataTransfer.files)
  console.log(paths)
})

Alternatives considered

No response

Additional context

Some discussions: https://discord.com/channels/616186924390023171/986184094050316358/1398270029329334373

https://github.com/MicrosoftEdge/WebView2Samples/blob/main/SampleApps/WebView2APISample/assets/ScenarioDragDrop.html

#14373

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions