Skip to content

[bug] onDragDropEvent not triggered on Windows 11 and default browser behavior occurs #13533

@Peng1203

Description

@Peng1203

Describe the bug

When using the onDragDropEvent as described in the Tauri v2 documentation, the event callback does not trigger on Windows 11. Additionally, the default browser behavior occurs, opening the file instead of intercepting the drag-and-drop.

OS: Windows 11

rustc: 1.87.0 (17067e9ac 2025-05-09)

cargo: 1.87.0 (99624be96 2025-05-06)

@tauri-apps/api: ^2.5.0

tauri.config.json: "dragDropEnabled": false

default.json: "permissions": ["core:window:allow-start-dragging"]

Reproduction

  1. Create a Tauri v2 project.
  2. Follow the example provided in the documentation for onDragDropEvent.
  3. Run the app on Windows 11.
  4. Drag a file into the Tauri window.

Expected behavior

  • The onDragDropEvent callback should be triggered.
  • The default browser behavior (opening the file) should be suppressed.

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.26100 x86_64 (X64)
    ✔ WebView2: 131.0.2903.86
    ✔ MSVC: Visual Studio 生成工具 2022
    ✔ rustc: 1.87.0 (17067e9ac 2025-05-09)
    ✔ cargo: 1.87.0 (99624be96 2025-05-06)
    ✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 18.20.4
    - pnpm: 10.4.0
    - yarn: 1.22.22
    - npm: 10.7.0
    - bun: 1.1.1

[-] Packages
    - tauri 🦀: 2.5.1
    - tauri-build 🦀: 2.2.0
    - wry 🦀: 0.51.2
    - tao 🦀: 0.33.0
    - @tauri-apps/api : 2.5.0
    - @tauri-apps/cli : 2.5.0

[-] Plugins
    - tauri-plugin-http 🦀: 2.4.4
    - @tauri-apps/plugin-http : 2.4.4
    - tauri-plugin-fs 🦀: 2.3.0
    - @tauri-apps/plugin-fs : 2.3.0
    - tauri-plugin-opener 🦀: 2.2.7
    - @tauri-apps/plugin-opener : 2.2.7
    - tauri-plugin-upload 🦀: 2.2.1
    - @tauri-apps/plugin-upload : 2.2.1
    - tauri-plugin-store 🦀: 2.2.0
    - @tauri-apps/plugin-store : 2.2.0
    - tauri-plugin-log 🦀: 2.4.0
    - @tauri-apps/plugin-log : 2.4.0
    - tauri-plugin-autostart 🦀: 2.3.0
    - @tauri-apps/plugin-autostart : 2.3.0
    - tauri-plugin-sql 🦀: 2.2.0
    - @tauri-apps/plugin-sql : 2.2.0
    - tauri-plugin-global-shortcut 🦀: 2.2.1
    - @tauri-apps/plugin-global-shortcut : 2.2.1
    - tauri-plugin-dialog 🦀: 2.2.2
    - @tauri-apps/plugin-dialog : 2.2.2
    - tauri-plugin-shell 🦀: 2.2.1
    - @tauri-apps/plugin-shell : 2.2.1
    - tauri-plugin-os 🦀: 2.2.1
    - @tauri-apps/plugin-os : 2.2.1
    - tauri-plugin-single-instance 🦀: 2.2.4
    - @tauri-apps/plugin-single-instance : not installed!
    - tauri-plugin-process 🦀: 2.2.1
    - @tauri-apps/plugin-process : 2.2.1

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

Stack trace


Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions