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] DragDropEvent::Drop does not add https:// url into paths vec. #10853

Open
lkdm opened this issue Sep 1, 2024 · 2 comments
Open

[bug] DragDropEvent::Drop does not add https:// url into paths vec. #10853

lkdm opened this issue Sep 1, 2024 · 2 comments
Labels
platform: macOS status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@lkdm
Copy link

lkdm commented Sep 1, 2024

Describe the bug

When dragging a file into the Tauri Window a WindowEvent::DragDrop event is created. If the file's source was the file system, it will be a relative path to that file. If the file's source is a browser, such as Firefox, it the paths Vec will be empty.

Reproduction

  1. Create a new Tauri app.
  2. In tauri.conf.json set dragDropEnabled to true
  3. Call the following method for the Tauri Builder:
tauri::Builder::default()
        .on_window_event(|_, event| match event {
            WindowEvent::DragDrop(drop) => {
                dbg!(drop);
            }
            _ => (),
        })
  1. Drag an image into the Tauri window.

Expected behavior

Console outputs:

[app/src-tauri/src/lib.rs:14:17] drop = Drop {
    paths: [
        "https://uploads.dailydot.com/2018/10/olli-the-polite-cat.jpg",
    ],
    position: PhysicalPosition {
        x: 407.0,
        y: 346.0,
    },
}

Full tauri info output

WARNING: no lock files found, defaulting to npm
       Error `tauri.conf.json` error on `build`: Additional properties are not allowed ('devUrl', 'frontendDist' were unexpected)
       Error `tauri.conf.json` error: Additional properties are not allowed ('app', 'bundle', 'identifier', 'productName', 'version' were unexpected)


### Stack trace

_No response_

### Additional context

_No response_
@lkdm lkdm added status: needs triage This issue needs to triage, applied to new issues type: bug labels Sep 1, 2024
@lkdm lkdm changed the title [bug] DragDropEvent::Drop does not parse https:// url into paths vec. [bug] DragDropEvent::Drop does not add https:// url into paths vec. Sep 1, 2024
@amrbashir
Copy link
Member

Can you update your tauri-cli and then post the output of tauri info?

@lkdm
Copy link
Author

lkdm commented Sep 3, 2024

@amrbashir Sure!

> tauri "info"


[✔] Environment
    - OS: Mac OS 14.6.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.80.1 (3f5fd8dd4 2024-08-06)
    ✔ cargo: 1.80.1 (376290515 2024-07-16)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 22.7.0
    - pnpm: 9.9.0
    - yarn: 1.22.22
    - npm: 10.8.2

[-] Packages
    - tauri 🦀: 2.0.0-rc.8
    - tauri-build 🦀: 2.0.0-rc.7
    - wry 🦀: 0.42.0
    - tao 🦀: 0.29.1
    - tauri-cli 🦀: 1.6.0
    - @tauri-apps/api : 2.0.0-rc.4
    - @tauri-apps/cli : 2.0.0-rc.10

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.0-rc.3
    - @tauri-apps/plugin-shell : 2.0.0-rc.1

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: macOS 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