#15861·tauri

[feat] get file path in drag events

Author: Legend-MasterCreated Aug 11, 2026Updated Sep 28, 2026
Labelstype: feature requestplatform: Windows

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:

typescript
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