-
Notifications
You must be signed in to change notification settings - Fork 1
fix: drag-and-drop uploads #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes issues with drag-and-drop uploads by updating the Upload component’s structure and integrating a new drop zone element while also adding supporting styles and event handlers.
- Modified Upload.vue to separate the browse and dropzone elements and added drag event listeners
- Updated Backup.vue to include an element with the id "statamic-backup" that serves as the drop container
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| client/src/components/Upload.vue | Updated drag-and-drop logic and DOM element assignments |
| client/src/components/Backup.vue | Added an id to the container to serve as the dropzone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR aims to restore and style drag-and-drop uploads by adding a persistent dropzone wrapper, a drag notification overlay, and wiring up drag/drop events.
- Moved the dropzone wrapper out of the original v-if so it’s always present for event binding.
- Introduced a
.drag-notificationoverlay that appears while dragging files. - Added dragenter/leave/drop event listeners and updated Resumable.js assignments to target the new wrapper.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| client/src/components/Upload.vue | Restructured dropzone wrapper, added drag-notification markup/styles, event listeners, and Resumable.js assign/unassign logic. |
| client/src/components/Backup.vue | Wrapped content in a div with id="statamic-backup" for the drop target. |
Comments suppressed due to low confidence (1)
client/src/components/Backup.vue:2
- [nitpick] Using a generic
idcan lead to conflicts if multiple backup components are rendered. Consider a more specific or dynamic identifier or rely on$refsto scope the drop target.
<div class="relative" id="statamic-backup">
Drag and drop uploads doesn't work as they should, this PR adds some styles to it aswell (how good it works i do not know)