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

(Ignore this pull request. Recreated on a separate branch) #68

Closed carter-thaxton closed 8 years ago

carter-thaxton commented 8 years ago

When dragging first or last element of the list, the logic to determine the new spliceIndex was not always working if spliceIndex ended up the same as originalIndex. This would result in no 'slip:reorder' event firing on mouseup/touchup.

This pull request fixes this by handling the edge cases of searching the list of otherNodes and not finding a node that satisifes the condition of "otherNode.pos > move.y" (or < move.y, when moving the other way).

This is a possible fix for issue #65.

carter-thaxton commented 8 years ago

Just closing this so I can create a new pull request using a branch, rather than using master.