Skip to content

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

@johnsogg

Description

@johnsogg

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions