Skip to content
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

Add support for drag and drop reordering of uploaded files #20

Closed
chrispappas opened this issue Oct 9, 2019 · 8 comments
Closed

Add support for drag and drop reordering of uploaded files #20

chrispappas opened this issue Oct 9, 2019 · 8 comments

Comments

@chrispappas
Copy link

This component looks really great, one thing that would be a killer feature would be the ability to reorder the uploads using drag and drop.

A number of projects I'm working on could really use an uploader component like this, but we need to offer the ability for users to upload in a specific order, to avoid requiring a second reordering step post-upload.

@safrazik
Copy link
Owner

Sounds like a good suggestion. I will consider supporting it in the future. Currently it can be implemented with the help of slots.

@Turbotailz
Copy link

+1 for re-ordering!

Any chance of an example using slots?

@safrazik
Copy link
Owner

OK I am trying to implement a drag sort example with the famous VueDraggable component from Sortable Js
I will update you when the example is ready.

@safrazik
Copy link
Owner

safrazik commented Nov 27, 2019

@chrispappas and @Turbotailz so the "killer feature" is finally there officially! 🎁
from version 1.4.0. You can see it working on the demo site: https://safrazik.github.io/vue-file-agent/ Learn more here.
After a lot of testing with available solutions, I made it work with vue-slicksort.

// npm install vue-slicksort --save

import { SlickList, SlickItem } from 'vue-slicksort';

Vue.component('vfa-sortable-list', SlickList);
Vue.component('vfa-sortable-item', SlickItem);

vfa-sortable-list and vfa-sortable-item components should be defined for sortable to work

      <VueFileAgent
       ...       
        :sortable="true"
        @sort="onSort($event)"
        ...
      ></VueFileAgent>

Thanks for bringing this up!

@chrispappas
Copy link
Author

chrispappas commented Nov 28, 2019 via email

@Turbotailz
Copy link

I'm trying the demo but having no luck with the dragging, where is the handle to drag each item? I managed to re-order one after a lot of trial and error but couldn't do it again.

@safrazik
Copy link
Owner

safrazik commented Dec 2, 2019

@Turbotailz you have to taphold/click&hold and drag for this to work. But looking at your comment, I'm thinking of a proper implementation. What do you think? Can you please open another issue?

@Turbotailz
Copy link

Ah! Works flawlessly given that info 😅

Yes I will make another issue.

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

No branches or pull requests

3 participants