wails icon indicating copy to clipboard operation
wails copied to clipboard

[v2.10.1] Native HTML drag & drop is broken

Open Choko256 opened this issue 1 month ago • 2 comments

Description

The default web behaviour of JavaScript drag'n'drop is not working. The dragover event is never emitted. It only happens in the wails window, it works fine by using the DevServer URL in the browser.

To Reproduce

You can easily reproduce that by creating a new wails project (whatever template you're using is the same, in order to be sure this wasn't a framework interference, I tested on vanilla).

  1. wails init -n dndtest -t vanilla

Change the index.html by adding a draggable box and a dropzone like these :

<div draggable="true" style="width:50px; height:50px; border: 1px solid blue;">DRAG ME</div>
<div style="border: 2px dotted gray; width: 300px; height: 300px;" id="dz"></div>

Add in the JS a little handler like

document.getElementById("dz").addEventListener("dragover", (ev) => {
  console.log(ev);
});
  1. cd dndtest
  2. wails dev
  3. Try to drag the boxes, the drag will start but the cursor will always be the not allowed sign and there is no log while passing the box over the dropzone.
  4. Open the DevServer URL in your browser, and the cursor will be the default one and the logs will start writing when dragging over the dropzone.

I can push a little repository with that code if it can help.

Expected behaviour

The dragover events should be fired in the wails window the same way it happens in the browser to allow native drag'n'drop feature to work properly.

Screenshots

No response

Attempted Fixes

No response

System Details

# Wails
Version         | v2.10.2
Package Manager | pacman 


# System
WARNING: failed to read int from file: open /sys/devices/system/cpu/cpu0/online: no such file or directory
┌───────────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | EndeavourOS                                                                    |
| Version      | Unknown                                                                        |
| ID           | endeavouros                                                                    |
| Branding     |                                                                                |
| Go Version   | go1.25.1 X:nodwarf5                                                            |
| Platform     | linux                                                                          |
| Architecture | amd64                                                                          |
| CPU          | 12th Gen Intel(R) Core(TM) i7-12700H                                           |
| GPU 1        | GA106M [GeForce RTX 3060 Mobile / Max-Q] (NVIDIA Corporation) - Driver: nvidia |
| GPU 2        | Alder Lake-P GT2 [Iris Xe Graphics] (Intel Corporation) - Driver: i915         |
| Memory       | 64GB                                                                           |
└───────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌────────────────────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version                    |
| *docker    | docker       | Installed | 1:28.5.1-1                 |
| gcc        | gcc          | Installed | 15.2.1+r22+gc4e96a094636-1 |
| libgtk-3   | gtk3         | Installed | 1:3.24.51-1                |
| libwebkit  | webkit2gtk   | Installed | 2.50.1-1                   |
| npm        | npm          | Installed | 11.6.2-1                   |
| pkg-config | pkgconf      | Installed | 2.5.1-1                    |
|                                                                    |
└───────────────────── * - Optional Dependency ──────────────────────┘

Additional context

No response

Choko256 avatar Oct 27 '25 23:10 Choko256