Sort Tolerance

Apr 18, 2012 at 4:32 PM

I'm using this great plugin to sort tabs (jquery ui tabs to be specific),

The problem is that clicking a tab frequently causes sorting to start, instead of actually clicking/activating the tab.

Is it possible to define some kind of sorting tolerance in pixels, for example specifying that the tab should start moving only after 10px drag ?

I'm looking for the counterpart for jquery ui's sortable plugin's "distance" option -




Apr 20, 2012 at 11:05 AM

I've uploaded a patch (ID 12014) for tolerance functionallity.

Apr 21, 2012 at 6:01 AM

Oh dear, I didn't know about the ability to post patches on this site and see there is a list of patches as far back 2009 awaiting my approval (I'm now subscribed for email notification).

Thanks for your suggestion. I've actually got dragsort setup not to trigger until you do move the mouse with the mouse button down so (change made in last release 0.5.1) so I guess it's equivalent to distance set to 1. So are you saying you're finding the mouse can move a few pixels for you when clicking hence why you want a margin like 10px? In that case I will look at applying your patch, will let you know when I put out the next release.

May 15, 2012 at 4:04 PM
Edited May 15, 2012 at 4:05 PM

I had the same (similar) issue as kaniga and just posted a diff under issues.  My changes were a bit different as I found that the reliance on closest to determine the drag target could cause drift when the tolerance allows you to move over a different element.

Using a value of 1 didn't work for me as the click event wasn't reliably fired (think older user with shaky hands!).  Adding a greater tolerance (I found 5 reasonable in my testing but configurable is even better as per kaniga's patch) seemed to get rid of the issue entirely.