[PR #2080] [CLOSED] fix(attachments): only show dropzone overlay for file drags, not text drags #9759

Closed
opened 2026-04-23 09:11:55 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2080
Author: @kolaente
Created: 1/10/2026
Status: Closed

Base: mainHead: fix-description-text-drag


📝 Commits (2)

  • f86be0a fix(attachments): only show dropzone overlay for file drags, not text drags
  • 8d86f09 refactor(attachments): register drag listeners only when edit is enabled

📊 Changes

1 file changed (+97 additions, -42 deletions)

View changed files

📝 frontend/src/components/tasks/partials/Attachments.vue (+97 -42)

📄 Description

Summary

  • Fixes #1663 - The file upload dropzone overlay was appearing for ALL drag operations, including text drags, blocking normal text manipulation in editors
  • Replaced useDropZone from VueUse with custom drag event handlers
  • Key fix: Only call event.preventDefault() for actual file drags (checked via dataTransfer.types.includes('Files'))
  • This allows native text dragging to work in Firefox (Chrome/Safari have known ProseMirror limitations)

Changes

  • Added isFileDrag() helper function to detect file drags vs text drags
  • Replaced VueUse's useDropZone with custom handleDragEnter, handleDragOver, handleDragLeave, handleDrop handlers
  • Used dragDepth counter to properly handle nested element drag events

Note on Chrome/Safari text dragging

Text dragging within the TipTap editor doesn't work in Chrome/Safari - this is a known ProseMirror limitation, not a Vikunja bug. The maintainer has stated this is "not supported" across browsers. Workaround: use cut/paste instead.

Test plan

  • Drag a file from desktop over the page (not over editor) → dropzone overlay appears
  • Drag selected text anywhere on page → dropzone does NOT appear
  • Drop file outside editor area → file uploads as attachment
  • Drop file over editor → TipTap handles it (no dropzone interference)
  • Text operations in editor work normally (select, copy, paste)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2080 **Author:** [@kolaente](https://github.com/kolaente) **Created:** 1/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-description-text-drag` --- ### 📝 Commits (2) - [`f86be0a`](https://github.com/go-vikunja/vikunja/commit/f86be0adf057c05a9339734efd11f8d318a26c18) fix(attachments): only show dropzone overlay for file drags, not text drags - [`8d86f09`](https://github.com/go-vikunja/vikunja/commit/8d86f09b50d52f517e13592b2cf4bf6a6ece06d5) refactor(attachments): register drag listeners only when edit is enabled ### 📊 Changes **1 file changed** (+97 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/tasks/partials/Attachments.vue` (+97 -42) </details> ### 📄 Description ## Summary - Fixes #1663 - The file upload dropzone overlay was appearing for ALL drag operations, including text drags, blocking normal text manipulation in editors - Replaced `useDropZone` from VueUse with custom drag event handlers - Key fix: Only call `event.preventDefault()` for actual file drags (checked via `dataTransfer.types.includes('Files')`) - This allows native text dragging to work in Firefox (Chrome/Safari have known ProseMirror limitations) ## Changes - Added `isFileDrag()` helper function to detect file drags vs text drags - Replaced VueUse's `useDropZone` with custom `handleDragEnter`, `handleDragOver`, `handleDragLeave`, `handleDrop` handlers - Used `dragDepth` counter to properly handle nested element drag events ## Note on Chrome/Safari text dragging Text dragging within the TipTap editor doesn't work in Chrome/Safari - this is a [known ProseMirror limitation](https://discuss.prosemirror.net/t/safari-draggable-paragraph-issue/2347), not a Vikunja bug. The maintainer has stated this is "not supported" across browsers. Workaround: use cut/paste instead. ## Test plan - [ ] Drag a file from desktop over the page (not over editor) → dropzone overlay appears - [ ] Drag selected text anywhere on page → dropzone does NOT appear - [ ] Drop file outside editor area → file uploads as attachment - [ ] Drop file over editor → TipTap handles it (no dropzone interference) - [ ] Text operations in editor work normally (select, copy, paste) 🤖 Generated with [Claude Code](https://claude.ai/code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-23 09:11:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#9759