Skip to content

[V3] Drag-and-drop broken on windows since alpha 19 #4489

Closed

Description

@xob0t

Description

No drag and drop events are triggered on the go side.

To Reproduce

Run dnd example on windows

Expected behaviour

For dnd to work :)

Screenshots

No response

Attempted Fixes

No response

System Details

 Wails (v3.0.0-alpha.20)  Wails Doctor 

# System 

┌──────────────────────────────────────────────────────────────────────────────┐
| Name              | Windows 10 Pro                                           |
| Version           | 2009 (Build: 19045)                                      |
| ID                | 22H2                                                     |
| Branding          | Windows 10 Pro                                           |
| Platform          | windows                                                  |
| Architecture      | amd64                                                    |
| Go WebView2Loader | true                                                     |
| WebView2 Version  | 138.0.3351.121                                           |
| CPU               | AMD Ryzen 5 5600X 6-Core Processor                       |
| GPU 1             | NVIDIA GeForce RTX 3070 (NVIDIA) - Driver: 32.0.15.7652  |
| Memory            | 32GB                                                     |
└──────────────────────────────────────────────────────────────────────────────┘

# Build Environment 

┌───────────────────────────────┐
| Wails CLI   | v3.0.0-alpha.20 |
| Go Version  | go1.24.5        |
| -buildmode  | exe             |
| -compiler   | gc              |
| CGO_ENABLED | 0               |
| GOAMD64     | v1              |
| GOARCH      | amd64           |
| GOOS        | windows         |
└───────────────────────────────┘

# Dependencies 

┌────────────────────────────────────────────┐
| NSIS                       | v3.11         |
| MakeAppx.exe (Windows SDK) | Not Installed |
| MSIX Packaging Tool        | Not Installed |
| SignTool.exe (Windows SDK) | Not Installed |
| npm                        | 10.8.1        |
|                                            |
└───────── * - Optional Dependency ──────────┘

# Checking for issues 

 SUCCESS  No issues found

# Diagnosis 

 SUCCESS  Your system is ready for Wails development!

Need documentation? Run: wails3 docs
 ♥   If Wails is useful to you or your company, please consider sponsoring the project: wails3 sponsor

Additional context

Likely caused by #4318

Activity

  1. added
    Bug
    on Aug 9, 2025
  2. github-actions commented on Aug 9, 2025

    @github-actions
    Contributor

    👋 Thanks for reporting this issue! To help us investigate, could you please:

    1. Add the output of wails doctor if not already included
    2. Provide clear steps to reproduce the issue
    3. If possible, create a minimal reproduction of the issue

    This will help us resolve your issue much faster. Thank you!

  3. added
    awaiting feedback
    on Aug 9, 2025
  4. dosubot commented on Aug 9, 2025

    @dosubot

    This was a known issue in Wails v3 alpha 19+ on Windows, but it has been fixed in recent updates. Two pull requests—#4259 and #4318—merged in August 2025, addressed broken drag-and-drop event handling, improved dropzone support, and fixed Windows-specific bugs in the Chromium WebView2 integration. The drag-and-drop example and event system were updated, and documentation now covers the new dropzone features and Go-side event handlers.

    If you’re still seeing broken drag-and-drop, update to a version of Wails that includes these PRs. For more details, check the events documentation and the drag-and-drop example.

    To reply, just mention @dosu.


    How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

  5. changed the title [-][V3] Drag-and-drop broken on windows on alpha 19+[/-] [+][V3] Drag-and-drop broken on windows since alpha 19[/+] on Aug 9, 2025
  6. itlangzi commented on Aug 16, 2025

    @itlangzi
  7. 25 remaining items

  8. itlangzi commented on Sep 23, 2025

    @itlangzi

    Interesting, is the example working? Runtime update had fixed it for me but I'm away from windows machine this week to debut

    v3.0.0-alpha.28

    Has wrong value for WindowDropZoneDropped
    at v3/internal/assetserver/bundledassets/runtime.debug.js line 630 var WindowDropZoneDropped = 49;
    but found v3\internal\runtime\desktop\@wailsio\runtime\src\window.ts line 69 const WindowDropZoneDropped = 50;
    this error causes the drag-and-drop not work

    e.g. v3/internal/assetserver/bundledassets/runtime.debug.js line 630

    var ZoomMethod = 45;
    var ZoomInMethod = 46;
    var ZoomOutMethod = 47;
    var ZoomResetMethod = 48;
    var WindowDropZoneDropped = 49;
    function getDropzoneElement(element) {
      if (!element) {
        return null;
      }
      return element.closest("[".concat(DROPZONE_ATTRIBUTE, "]"));
    }

    e.g. v3\internal\runtime\desktop\@wailsio\runtime\src\window.ts line 69

    const ZoomInMethod                      = 46;
    const ZoomOutMethod                     = 47;
    const ZoomResetMethod                   = 48;
    const SnapAssistMethod                  = 49;
    const WindowDropZoneDropped             = 50;
    
    function getDropzoneElement(element: Element | null): Element | null {
        if (!element) {
            return null;
        }
        // Allow dropzone attribute to be on the element itself or any parent
        return element.closest(`[${DROPZONE_ATTRIBUTE}]`);
    }
  9. leaanthony commented on Sep 25, 2025

    @leaanthony
    Member

    Can you please try the latest alpha release 👍

  10. xob0t commented on Sep 25, 2025

    @xob0t
    Author

    Still does not work. devtools console logs dropped files, but no logs on the backend.

    Tested on alpha 29 with dnd example on windows 10

  11. itlangzi commented on Sep 26, 2025

    @itlangzi

    Can you please try the latest alpha release 👍

    v3.0.0-alpha 30
    The error still exists
    and @wailsio/runtime 3.0.0-alpha.69 does not work either
    Recompiling runtime.js from source will work fine.

  12. leaanthony commented on Sep 27, 2025

    @leaanthony
    Member

    @itlangzi - That was the key to the issue - thanks! 🙏 Pipeline fixed and @wailsio/[email protected] just got published

  13. itlangzi commented on Sep 30, 2025

    @itlangzi

    @itlangzi - That was the key to the issue - thanks! 🙏 Pipeline fixed and @wailsio/[email protected] just got published

    The problem is not solved; it seems that you forgot to include compiled/main.js when building the @wailsio/runtime release package, which causes window.wails.Window.HandlePlatformFileDrop always be undefined

  14. WXjzcccc commented on Sep 30, 2025

    @WXjzcccc

    @itlangzi - That was the key to the issue - thanks! 🙏 Pipeline fixed and @wailsio/[email protected] just got published

    The problem is not solved; it seems that you forgot to include compiled/main.js when building the @wailsio/runtime release package, which causes window.wails.Window.HandlePlatformFileDrop always be undefined

    You are right. That's why dnd example works normally, but it doesn't work in our project. Because we use npm package , and window.wails is {}

  15. added 3 commits that reference this issue on Oct 2, 2025
    20660de
    9aad5db
    6665a3a
  16. xob0t commented on Oct 2, 2025

    @xob0t
    Author

    Fixed in alpha 32!
    I had to refactor the app to work with WindowDropZoneFilesDropped, as WindowFilesDropped was not working for me anymore.

  17. added a commit that references this issue on Apr 29, 2026
    45e94b0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugWindowsawaiting feedbackinvestigatingruntimev3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions