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

Add option to ignore elements #102

Closed myfrom closed 6 years ago

myfrom commented 6 years ago

As I described in #101, some frameworks might inject invisible elements to the Slip container. Having an invisible item in Slip container causes every item that is dragged down, no matter where dropped, to report as it moved to the last position. Here's a demo

I added a configuration value that if set would ignore specified selectors from node search so you could skip detecting invisible elements in Slip container. It swaps back to old behavior when the option is not defined. Here's how the demo looks like with my fix

The only problem is when the ignored element is visible, it may cause some weird behavior. To prevent this I tried describing the option in readme file.

Closes #101

kornelski commented 6 years ago

Thanks for the PR!