Sortable icon indicating copy to clipboard operation
Sortable copied to clipboard

Sortable stops working after i click my drag handle

Open bramdebouvere opened this issue 10 years ago • 10 comments

I have a little issue, but i'm not sure why i can't reproduce it in http://rubaxa.github.io/Sortable/ ..

When I just click my drag handle, sortable stops working. I spent my entire day debugging this, and I noticed Sortable.active is null or undefined when the nulling function executes. But this only happens when I click the element. As a result of this, values like dragEl are not cleared, and because of this it's not longer possible to drag.

I changed the code to this, and now I no longer have an issue.

_nulling: function ()
        {
            if (Sortable.active === this || !Sortable.active)
            {

Not really sure why I can't reproduce this in the page above though.

I really like Sortable, by the way.. hands down the best drag&drop library I ever encountered.

bramdebouvere avatar Jul 24 '16 16:07 bramdebouvere

Not sure if this is a correct fix, though..

bramdebouvere avatar Jul 24 '16 16:07 bramdebouvere

I had the same issue, but it was from any click on the element, not just the handle, and this change fixed it.

AusQB avatar Jul 26 '16 04:07 AusQB

Hello, can you precise at what line of what file did you change the code? Thanks for your help ^^

FloJess avatar Jul 26 '16 11:07 FloJess

@FloJess The above function is at line 826 of the master branch (Sortable.js), with the changed line being 827.

AusQB avatar Jul 26 '16 11:07 AusQB

Thanks @bramdebouvere for your fix. I was having the same issue and couldn't figure out what was causing it.

picitelli avatar Jul 26 '16 17:07 picitelli

Please implement this simple fix, it solves all my problems as well of Sortable being disabled after a simple click

gpetrov avatar Aug 26 '16 09:08 gpetrov

It solved my problem too, thanks !

jspaeter avatar Aug 30 '16 09:08 jspaeter

I also have this problem and the patch provided works great!

Please merge pull request #924 so that everyone can benefit from this fix =)

bcole808 avatar Aug 31 '16 21:08 bcole808

solution worked for me too. 100% worth applying it to the lib.

vbelolapotkov avatar Oct 24 '16 09:10 vbelolapotkov

Thanks worked here too!

vincent90 avatar Nov 08 '16 18:11 vincent90