alantoa / react-native-awesome-slider

🚀 An anwesome <Slider/> that supports various features haptic, lottie, animation, ballon, etc.
MIT License
228 stars 28 forks source link

Configure step snapping #28

Closed layerok closed 1 year ago

layerok commented 1 year ago

I made this PR to be able to make the slider like in the video below (conditionally rendered custom step marks and disabled snapping)

https://user-images.githubusercontent.com/18424848/200710179-0fcc24a9-ade6-4efd-8f8a-ca7fbbd9c7c3.mp4

What does this PR do?

  1. Fixes build failure when building an android app. Explained here: https://github.com/facebook/react-native/issues/35210
  2. Makes step snapping configurable
  3. Allows to render custom step marks and also render them conditionally
  4. Adds the example of the slider with disabled step snapping
alantoa commented 1 year ago

hi @adjustmentlayer, thanks for your PR, I'll check it ASAP!

layerok commented 1 year ago

@alantoa Thanks, it would be great. By the way, when I was testing my changes, I also noticed that stepped slider has bug. When you move thumb, after you release the touch, the thumb returns on the position the touch was started from. But when you do tap gesture, then slider works fine. You can see what I mean in the video below.

https://user-images.githubusercontent.com/18424848/201079167-79ee26d8-d8de-4f85-a944-c09cbc6ec33d.mp4

I am telling it to you to say that this bug was before my changes.

efstathiosntonas commented 1 year ago

@adjustmentlayer did you fixed that bug or you're just mentioning it? It's not clear if you've fixed it or not, sorry.

layerok commented 1 year ago

@efstathiosntonas I didn't fix it in this PR. I thought it would be a lot to test in 1 PR

layerok commented 1 year ago

But I probably found the fix for this bug. But I am not sure about it

efstathiosntonas commented 1 year ago

ok thanks, yeah, it would be better to create another PR for this bug.

alantoa commented 1 year ago

hey @adjustmentlayer I just released v2.2.1 on npm, and fixed you mentioned bug before.