Skip to content

fix: enable HTML5 drag-drop on Windows (print analysis drop zone) - #15

Merged
gandulfy merged 1 commit into
mainfrom
gandulfy-fix-windows-drag-drop-print-analysis
Jul 11, 2026
Merged

fix: enable HTML5 drag-drop on Windows (print analysis drop zone)#15
gandulfy merged 1 commit into
mainfrom
gandulfy-fix-windows-drag-drop-print-analysis

Conversation

@gandulfy

Copy link
Copy Markdown
Collaborator

Why

On Windows, dragging an image from File Explorer onto the Print Analysis drop zone did nothing. The drop handler never received any files because DragEvent.dataTransfer.files was always empty.

What changed

Set "dragDropEnabled": false in the Tauri window configuration (src-tauri/tauri.conf.json).

By default, Tauri v2 sets dragDropEnabled: true, which causes Tauri to intercept OS-level file drops at the WebView2 layer and handle them via its own tauri://drag-drop event. A side effect is that the standard HTML5 DataTransfer.files list is left empty -- so the existing on:drop handler in PhotoDropZone never found any files to process on Windows.

Disabling Tauri's interception passes the drop event back to WebView2 directly, which correctly populates DataTransfer.files and lets the existing handler work as intended. No frontend code changes are needed. macOS and Linux are unaffected.

In Tauri v2, dragDropEnabled defaults to true which causes Tauri to
intercept OS-level file drops, leaving DataTransfer.files empty in the
WebView2 HTML5 DragEvent on Windows. Setting dragDropEnabled: false
passes file drops back to the WebView so the existing drop zone handler
works as expected.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@gandulfy
gandulfy merged commit e374d4f into main Jul 11, 2026
3 checks passed
@gandulfy
gandulfy deleted the gandulfy-fix-windows-drag-drop-print-analysis branch July 12, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant