-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
Do not snap on manually setting a value #436
Comments
Yes, don't set a step. Then, on the I've set up an example demonstrating this. |
Hi, First, i have a non-linear range with various steps sizes. But I could get this working by iterating through the steps. The bigger issue is, that with your solution the user sees a "non-step" value when dragging and it adjusts when the handle is released. What I thought could work: |
Hi, I finally wound a "not that beautiful" solution: When passing the parameter "exactInput" to true, the snapping works only on "move" and "tap". I pass the action-types to setHandle and then do or do not execute getStep: // EDIT: do not snap to next step when action is not move and exactInput is true
if(["move", "tap"].indexOf(action) >= 0 || !options.exactInput) {
to = $Spectrum.getStep( to );
} Here my working example: https://jsfiddle.net/4xe0jq3y/1/ (scroll down below my minified version to see the call). Like I said it's not a perfect solutions, but maybe you could think about integrating it into your code. Should I send you my file? Yours, |
Sorry for commenting on a "zombie" but I had the same requirement and found this issue via google. Works flawless even with the ng-nouislider in Angular. component.html
component.ts
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi,
first of all - great script!
My only problem is this:
I have a slider with steps and snapping active (the user should be able to drag in certain steps only).
But what I want to have is the possibility of setting a value manually (via input) which doesn't not fit to a step.
i.e.:
range from 0 - 1000, steps 100.
user should be able to set 0, 100, 200, ..., 800, 900, 1000 via the slider-drag.
AND user should be able to set any value (like 123) via an input without the slider snapping to the nearest step (100). (if the handler would be set correctly too, it would be just perfect!)
Is this possible?
thanks,
janein
The text was updated successfully, but these errors were encountered: