Skip to content
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

[bug] tauri://drop-over missing files path #9823

Closed
farfromrefug opened this issue May 19, 2024 · 4 comments
Closed

[bug] tauri://drop-over missing files path #9823

farfromrefug opened this issue May 19, 2024 · 4 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@farfromrefug
Copy link

Describe the bug

I am upgrading my app to tauri v2 and i am using svelte-tauri-filedrop. So i am also upgrading that component which relies on drop events.
The first issue is that it not really documented how the events name changed. Would be nice to have that in the migration page.
Now the biggest issue is that those new events are useless without files path. We now only have the position of the drop (which is nice).
Could we have this fixed ?
It is a show stopper for apps, using drag&drop, to migrate to v2

Reproduction

example here https://github.com/probablykasper/svelte-tauri-filedrop

Expected behavior

example working

Full tauri info output

[✔] Environment
    - OS: Pop!_OS 22.04 X64
    ✔ webkit2gtk-4.1: 2.44.0
    ✔ rsvg2: 2.52.5
    ✔ rustc: 1.75.0 (82e1608df 2023-12-21)
    ✔ cargo: 1.75.0 (1d8b05cdd 2023-11-20)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 20.9.0
    - yarn: 4.0.2
    - npm: 10.1.0

[-] Packages
    - tauri [RUST]: 2.0.0-beta.19
    - tauri-build [RUST]: 2.0.0-beta.15
    - wry [RUST]: 0.39.5
    - tao [RUST]: 0.28.0
    - @tauri-apps/api [NPM]: 2.0.0-beta.11
    - @tauri-apps/cli [NPM]: 2.0.0-beta.17

[-] App
    - build-type: bundle
    - CSP: default-src blob: data: filesystem: ws: wss: asset: mbtiles: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'; worker-src blob:; connect-src ipc: https://ipc.localhost
    - frontendDist: ../build
    - devUrl: http://localhost:3000/
    - framework: Svelte
    - bundler: Vite

Stack trace

No response

Additional context

https://discordapp.com/channels/616186924390023171/1239492999382302730

@farfromrefug farfromrefug added status: needs triage This issue needs to triage, applied to new issues type: bug labels May 19, 2024
@amrbashir
Copy link
Member

This was by design to avoid some memory allocations on repeated events like hover, instead you get the file paths first on entry and then again on drop. I don't know the use-case or the need for paths on each hover event but the plugin will need to update its code to save the paths on entry into a variable and use these again in the hover events.

@amrbashir amrbashir closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2024
@farfromrefug
Copy link
Author

@amrbashir could you at least describe the new events like the entry one ? There is no doc on migration to the new events

@amrbashir
Copy link
Member

https://beta.tauri.app/references/javascript/api/namespaceevent/#enumeration-members

entry event is called: tauri://drag, we probably need to change these event names

@amrbashir
Copy link
Member

We will make sure to update the migration guide before v2 stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants