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

How can I remove out some item? #1459

Closed
big-tutu opened this issue Feb 28, 2019 · 4 comments
Closed

How can I remove out some item? #1459

big-tutu opened this issue Feb 28, 2019 · 4 comments

Comments

@big-tutu
Copy link

big-tutu commented Feb 28, 2019

Problem: There are tow groups A and B, I drag an element from group A to some place not group B, where can't accept this item. Because I want remove it instead back it's old position.

I used Vue-draggable.

@owen-m1
Copy link
Member

owen-m1 commented Mar 2, 2019

@big-tutu Something like this:

Sortable.create(el, {
    onEnd(evt) {
        var target = evt.originalEvent.target;
        if (el !== target && !el.contains(target)) {
            // remove `target`
        }
    }
});

@owen-m1
Copy link
Member

owen-m1 commented Mar 9, 2019

A feature to solve this could be #1465

@owen-m1
Copy link
Member

owen-m1 commented Jun 3, 2019

Now you can use the removeOnSpill plugin (included by default).

new Sortable(el, {
    removeOnSpill: true
});

@owen-m1 owen-m1 closed this as completed Jun 3, 2019
@codigoart
Copy link

codigoart commented Sep 14, 2019

removeOnSpill: true is good works in computer but does not work in my iphone may be same to all mobiles ? can some one help ?

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