Skip to content

fix: disable Tauri drag-drop handler to restore HTML5 file drag-and-drop in WebView - #168

Merged
zouyonghe merged 2 commits into
mainfrom
copilot/fix-drag-and-drop-attachment
Aug 11, 2026
Merged

fix: disable Tauri drag-drop handler to restore HTML5 file drag-and-drop in WebView#168
zouyonghe merged 2 commits into
mainfrom
copilot/fix-drag-and-drop-attachment

Conversation

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

On Windows, Tauri's built-in native drag-drop handler intercepts file drag events before they reach the WebView2 renderer, silently swallowing them. This breaks the ChatUI's existing dragover/drop handlers — dragging files from Explorer into the chat input does nothing, while the file picker works fine. The issue does not affect browser-based WebUI.

Change

  • src-tauri/tauri.conf.json: Set dragDropEnabled: false on the main window to disable Tauri's native drag-drop interceptor, letting file drag events propagate to the WebView as standard HTML5 events.
  "fullscreen": false,
- "backgroundThrottling": "disabled"
+ "backgroundThrottling": "disabled",
+ "dragDropEnabled": false

No changes to application code are needed — ChatUI already implements dragover/drop handlers that read event.dataTransfer.files and feed them into the existing attachment upload flow.

Summary by Sourcery

Bug Fixes:

  • Restore file drag-and-drop support in the chat UI WebView by preventing Tauri from intercepting drag events before they reach the renderer.

…WebView

Co-authored-by: zouyonghe <62183434+zouyonghe@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix drag and drop attachment issue in desktop ChatUI fix: disable Tauri drag-drop handler to restore HTML5 file drag-and-drop in WebView Aug 11, 2026
Copilot AI requested a review from zouyonghe August 11, 2026 07:14
@zouyonghe
zouyonghe marked this pull request as ready for review August 11, 2026 07:22

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@zouyonghe
zouyonghe merged commit 7bb4447 into main Aug 11, 2026
4 checks passed
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.

[Bug] 桌面版 ChatUI 无法通过拖拽添加文件附件

2 participants