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

Suggestion: slip:beforeswipe event based on direction (left/right) #42

Closed mauron85 closed 8 years ago

mauron85 commented 9 years ago

I would like to prevent swiping based on swipe direction (left/right). Not sure if this can be implemented. Example:

list.addEventListener('slip:beforeswipe', function(e, direction) {
    if (direction === 'left') {
        e.preventDefault();
    }
});
slmjkdbtl commented 9 years ago

+1 I'm also looking for this.

darrynten commented 9 years ago

I've solved this issue in #56 (amongst other enhancements and features)

You'll get the direction in e.details.directionX and e.details.directionY

mauron85 commented 9 years ago

Thank you. Looks I like a big improvement. Will try it out.