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] Drag-and-Drop doesn't handled properly on Linux #9725

Open
xingrz opened this issue May 9, 2024 · 2 comments
Open

[bug] Drag-and-Drop doesn't handled properly on Linux #9725

xingrz opened this issue May 9, 2024 · 2 comments
Labels
status: needs triage This issue needs to triage, applied to new issues status: upstream type: bug

Comments

@xingrz
Copy link

xingrz commented May 9, 2024

Describe the bug

As far as we know, by default, Tauri handles drag-n-drop via its own tauri://drop and related events.

While in Linux (both Ubuntu 22.04 and 24.04), once a file is dropped onto the window, an tauri://drag-cancelled is emitted instead, and the webview is unexpectedly navigated to the dropped file.

Reproduction

Link: https://github.com/xingrz/tauri-v2-drag-n-drop

  1. Run the demo
  2. Open the Web Inspector, and switch to Console tab. Enable Preserve Log
    image
  3. Drag and drop some file(s) onto the window
image

As its shown in the screenshot below, tauri://drag-cancelled is emitted, and the webview is navigated to the file (package.json) just dropped.

Expected behavior

image

A tauri://drop should be emitted. In the above minimal reproduction, size of the dropped file is displayed.

Full tauri info output

$ npm run tauri info

> tauri-v2-drag-n-drop@0.0.0 tauri
> tauri info


[✔] Environment
    - OS: Ubuntu 24.04 X64
    ✔ webkit2gtk-4.1: 2.44.0
    ✔ rsvg2: 2.58.0
    ✔ rustc: 1.78.0 (9b00956e5 2024-04-29)
    ✔ cargo: 1.78.0 (54d8815d0 2024-03-26)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-unknown-linux-gnu (default)
    - node: 20.13.0
    - npm: 10.5.2

[-] Packages
    - tauri [RUST]: 2.0.0-beta.18
    - tauri-build [RUST]: 2.0.0-beta.14
    - wry [RUST]: 0.39.4
    - tao [RUST]: 0.27.1
    - @tauri-apps/api [NPM]: 2.0.0-beta.11
    - @tauri-apps/cli [NPM]: 2.0.0-beta.16

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - bundler: Vite

Stack trace

No response

Additional context

No response

@xingrz xingrz added status: needs triage This issue needs to triage, applied to new issues type: bug labels May 9, 2024
@sidstory
Copy link

not work on macos too.

@xingrz
Copy link
Author

xingrz commented May 11, 2024

not work on macos too.

Works on my macOS 14.4.1

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 status: upstream type: bug
Projects
None yet
Development

No branches or pull requests

3 participants