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

Setting value can fail if min/max are not explicitly set #35

Open
johnsogg opened this issue Jun 8, 2017 · 0 comments
Open

Setting value can fail if min/max are not explicitly set #35

johnsogg opened this issue Jun 8, 2017 · 0 comments

Comments

@johnsogg
Copy link

johnsogg commented Jun 8, 2017

I set up the slider like this in the template:

          {{ui-slider
             value=(inch-to-slider-ticks offsetInches)
             action=(action 'spaceSlider')
             ticks='0, 128, 256, 384, 512, 640, 768, 896, 1024'
             ticksLabels='None, 1/8", 1/4", 3/8", 1/2", 5/8", 3/4", 7/8", 1"'
             tooltip='hide'
             step=64 }}

The user can type a value in to a textbox elsewhere, which causes the offsetInches binding to kick in, and the slider is handed a new value, e.g. 123. But immediately the slider would report an action that the value had changed to 10.

Looks like this also happens to be the default max value: https://github.com/lifegadget/ui-slider/blob/master/addon/components/ui-slider.js#L38

Discovered that if I explicitly set the min and max properties to 0 and 1024 respectively, the slider behaves as corrected.

Maybe the min and max props should float depending on ticks?

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

1 participant