-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
No support for dropping files? #2768
Comments
you can use tauri's |
Alright thanks 👍 |
Did you get this to work eventually? My app won't receive any file drop on windows. The cursor simply turned into a disabled state. Edits: I figured it out that the cursor turned into disable state only happens when run the app from VS code's integrated terminal on windows. If start |
@shenghan97 this works for me: import { listen } from '@tauri-apps/api/event'
listen('tauri://file-drop', event => {
console.log(event)
}) |
on Ubuntu 22 Tauri Dev mode latest with |
I need to drag and drop the file into the webview to get the parseable file content, I am using the fs system works with the URL in the event callback now, does Tauri provide an existing API to achieve the same effect? |
Does this support multiple files being drag and dropped onto the web view? And we'd get the full filepaths of each dropped file? |
yes, the |
If anyone stumble into this lost on why your dropzone input isn't working, just disable the |
If anyone want to set it in rust code, just read this: let window = tauri::WindowBuilder::from_config(
app,
WindowConfig {
label: "main".to_string(),
url: tauri::WindowUrl::App("index.html".into()),
file_drop_enabled: false, // notice this
..Default::default()
},
)
.build()
.unwrap(); |
Can confirm on OSX: disabling the fileDropEnabled in the tauri.config lets the window successfully process the file drag and drop instead. |
Update for those who're using v2: import { listen } from "@tauri-apps/api/event";
listen('tauri://drag-drop', event => {
console.log(event)
}) |
in v2 you can set it in your |
Describe the bug
I'm in the process of porting a webapp into Tauri, and I need to drop files into a text editor (it's a CodeMirror instance). This worked without issue in the browser or in Electron, but Tauri does not trigger anything when a file is dropped. Even an
ondrop
on the topmost div does nothing.To Reproduce
ondrop
event on a Tauri app.Expected behavior
The
ondrop
event should trigger.Screenshots
n/a
Platform and Versions (required):
The text was updated successfully, but these errors were encountered: