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

Light version request #87

Open Sauvage9 opened 7 years ago

Sauvage9 commented 7 years ago

I'm looking for a lightweight true javascript sort lib for lists. Slip is a wonderful and efficient piece of code, but I would like a stripped version:

I already made an attempt to strip the code but I'm guessing the actual author will do a better job knowing all dependencies...

myleftshoe commented 5 years ago

I created a 'lightweight' (no aria or swiping) for use in a react project if yr still interested:

[Source] [React app demo]

You can just pull out the slip.js and slip.css files from the repo. Don't think it will work outside react context though as it uses some es6 features.

carter-thaxton commented 5 years ago

I’m curious why it was necessary to strip down this library. The swiping functionality isn’t very large. If you have a contribution to slip.js that would help use it in a React context, I think that would be a useful PR.

As it stands, I thank you for the demo, but it would not really be usable if it doesn’t support the existing functionality and backward compatibility.

myleftshoe commented 5 years ago

I tried a number of react sortable libraries - react-beautiful-dnd, react-smooth-dnd, react-sortable-hoc, react-spring. This was this only library that worked without "jank" or scrolling issues while dragging, and at very close to 60fps on a low end Windows mobile running Edge ( pretty niche user base).

I'm not the greatest js/front end developer in the work so I stripped out things I didn't need in order to understand how it worked. I tweaked it a bit and since it's for my own use, didn't bother putting it back in.

One tweak I did might be useful for this repo - animate smoothly into position on drop. You can see it in the demo.