Skip to content

'enforceStep' option is ignored #287

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

Closed
euvs opened this issue Mar 3, 2016 · 6 comments
Closed

'enforceStep' option is ignored #287

euvs opened this issue Mar 3, 2016 · 6 comments

Comments

@euvs
Copy link

euvs commented Mar 3, 2016

It seems that enforceStep option is ignored.

I want to display ticks from 0 to 24 with step 1, but be able to drag the slider to any value between 0 and 24 that is not rounded to the step.

I expected that if I set enforceStep to false, the slider handle can be positioned in between ticks/steps. However, no matter whether it is set to true or false, the handle position is always snapped to the ticks.

Is it intended usage of the enforceStep option? if not, is it possible to achieve the described above behaviour?

Thank you.

@Liam-Ryan
Copy link
Contributor

The enforceStep option will not enforce snapping to steps if it is set to
false and the value is changed* externally. *So if you set up your slider
and then alter the value to 1.234124 or something similar the value will
snap when it is true but not if it is false.

On Thu, Mar 3, 2016 at 11:19 AM, Evgeny V [email protected] wrote:

It seems that enforceStep option is ignored.

I want to display ticks from 0 to 24 with step 1, but be able to drag the
slider to any value between 0 and 24 that is not rounded to the step.

I expected that if I set enforceStep to false, the slider handle can be
positioned in between ticks/steps. However, no matter whether it is set to
true or false, the handle position is always snapped to the ticks.

Is it intended usage of the enforceStep option? if not, is it possible to
achieve the described above behaviour?

Thank you.


Reply to this email directly or view it on GitHub
#287.

@euvs
Copy link
Author

euvs commented Mar 3, 2016

Just to clarify. When you are saying "externally" do you mean by dragging the slider with the mouse? or by setting the value in the code somewhere?

@Liam-Ryan
Copy link
Contributor

Setting the value in the code, it's expected that you would populate all of
the ticks you want users to be able to select by dragging. The use case for
enforceStep is something like you're setting the slider based on a loan
formula and it may return an amount of 123.12 where you normally only allow
amounts in increments of 50

On Thu, Mar 3, 2016 at 11:31 AM, Evgeny V [email protected] wrote:

Just to clarify, by saying "externally" you mean by dragging the slider
with the mouse? or by setting the value in the code somewhere?


Reply to this email directly or view it on GitHub
#287 (comment)
.

@euvs
Copy link
Author

euvs commented Mar 3, 2016

Ok. I see. So it is not currently possible to set the slider in between ticks by dragging it with the mouse. Am I correct?

What I want to achieve is to display a slider with a timescale from 0:00 to 24:00 hours with ticks every hour, but be able to drag the slider in between the ticks so the users could select, for instance, 13h23min.

I think it would be nice to have at least two types of steps: "Ticks step" (for displaying on the UI) and "Slider step" (for restricting/rounding the slider value). Or have an option where the slider value is not rounded to thicks.

@ValentinH
Copy link
Member

I think that there is a on-going PR that address your need: #264.

@euvs
Copy link
Author

euvs commented Mar 3, 2016

Great!. Thanks. It looks very promising.

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

No branches or pull requests

3 participants