-
-
Notifications
You must be signed in to change notification settings - Fork 500
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
Problems using enforceRange/enforceStep #410
Comments
Well, this is because it is not supposed to be used with the stepsArray option. I can see what you are trying to do, but this is not possible with the current version of this library... |
I had the similar problem, and I think your problem is the data type of price. You set a integer values as a price in slider, but the input text change this value to string. @richardkhchang, you can change values to string type:
@ValentinH this behavior is because in the method findStepIndex the step index is finding by value and type value also, I think this is OK :)
|
Looking through the scripts themselves, it doesn't look like the existing library does what I was hoping it would do regardless of the fix above (it looks like there is no support for sliding to a value that does not exactly match a value specified in the stepsArray). I'll find a workaround. Thanks anyways. |
Indeed, the closest thing that can be done is to use a value greater than 1 for showTicks/showTicksValues... |
@ValentinH any progress with this? Can I use |
This is not supported and I think it won't be trivial to support this. However, if you really need this, you can submit a PR. 🙂 |
Hi,
I'm currently trying to use this control to create a price range filter.
This is my slider:
And this is my front-end markup:
As you can see, I have both the angularjs-slider as well as two "number" textboxes hooked up to the same model, "slider.minValue", and "slider.maxValue". When the slider is manipulated, the values in the textbox correctly update to the selected value in "stepsArray". This much is working correctly.
However, I want to allow the user to enter into the textboxes a specific price range that does not perfectly match the values in the "stepsArray". I was hoping that doing this would move the slider to the appropriate position between the defined steps, and that subsequent slider movements would snap the values back in sync with the "stepsArray".
Looking at readme.md, I'm under the impression that the enforceStep or enforceRange properties would allow me to do this by setting one or the other to false.
However, in practice, regardless of whether or not these properties are set to false, whenever I change the value of the min or max price in the text boxes, the slider does not respect this quantity and always moves the slider/textbox value back to the value "1".
Please let me know if what I want to do is possible or if I'm misunderstanding how enforceStep and enforceRange are supposed to work.
Thanks,
Richard Chang
The text was updated successfully, but these errors were encountered: