Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't go from 100% to 0% if the swipe continues #13

Open
ghost opened this issue Jul 1, 2019 · 5 comments
Open

Don't go from 100% to 0% if the swipe continues #13

ghost opened this issue Jul 1, 2019 · 5 comments

Comments

@ghost
Copy link

ghost commented Jul 1, 2019

I have a 270 degree slider. If I swipe beyond 100%, (or reach too close to the starting point), the slider resets to 0%!
Can you add a setting where the slider will stay at 100% (and symetrically at 0%) if we over (or under) swipe?

Thanks!

@ThunderStruct
Copy link
Owner

That was requested already and (good news!) I already implemented it. I'm currently implementing a few more features and fixes I have on my list before I commit the changes and update the pod. Should be out by tomorrow hopefully!

@ThunderStruct
Copy link
Owner

Released 1.3.0 and updated the pod!

@ghost
Copy link
Author

ghost commented Jul 8, 2019

I've upgraded to 1.3.0 and set maximumRevolutions to 0. But since my slider is 300 degrees (not a full circle), this doesn't work. Is there any reason why there is a limitation of this feature to work with only full circles?

@ThunderStruct
Copy link
Owner

ThunderStruct commented Jul 8, 2019

I see... I may have misunderstood what you meant at first!

The reason why this works on full circles only is because semi-circular sliders stop at 100% by default. However, when you slide further, it would snap back at 0%, which (as I understand) is your issue here.

Even if the slider is a full circle and you set maximumRevolutions to 0, it would still snap to other values after 180 degrees beyond 100% (you could try it to get a better grasp on what I mean).

The problem with what you're asking for is that the slider computes the handle's angle and value based solely on the current touch location, neglecting any previous sliding. I.e: given a certain touch location, the handle would get drawn at its corresponding angle.
I thought of a couple of workarounds off the top of my head now that could essentially solve this issue, but unfortunately it'll probably take a few days (possibly a couple of weeks) to implement it because I'm really busy these few days! Regardless, I'm reopening the issue in case anyone wants to implement it and PR in the time being. Have a good day!

@ghost
Copy link
Author

ghost commented Jul 8, 2019

Thank you! That's exactly what I mean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant