kornelski / slip

Slip.js — UI library for manipulating lists via swipe and drag gestures
BSD 2-Clause "Simplified" License
2.44k stars 213 forks source link

Odd jump if I only move an item down one spot #54

Closed jorjordandan closed 9 years ago

jorjordandan commented 9 years ago

Hi - this is a great library, so first off, thanks!

I'm using Slip to add reordering to meteoric, the meteor port of the ionic framework, but I have a small glitch. When I move an item down only one spot, it animates up at the last second, after I let go. You can see the issue here (click the upper right-hand corner to enable re-ordering).

The implementation is here.

I noticed your demo doesn't have this issue, so I understand this is probably an implementation issue, but if someone could give me a hint about where to start looking, I'd definitely appreciate it.

jorjordandan commented 9 years ago

Oddly enough, if I comment out this line of Slip.js there is no issue. What else does this line affect?

kornelski commented 9 years ago

This line is supposed to animate move of the element back to its original position.

kornelski commented 9 years ago

when you reorder, call preventDefault to prevent that animation.