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

Dynamically updating the slider #20

Open
kgish opened this issue Jun 22, 2017 · 1 comment
Open

Dynamically updating the slider #20

kgish opened this issue Jun 22, 2017 · 1 comment

Comments

@kgish
Copy link

kgish commented Jun 22, 2017

Hi there. Is it possible to dynamically update the sliders, for example changing another slider while sliding another?

Use case: I have a number of sliders whose totals are constrained by a fixed value. If I slide a given slider, I want to change the remaining sliders so that the total of all slider values remains constant.

Any ideas how I might want to achieve this?

@cowboyd
Copy link
Member

cowboyd commented Jun 26, 2017

Sounds like you need a containing component that accounts for the individual slider bounds for all of your sliders. Consider the following:

{{#slider-constraints as |constraints|}}
  {{x-range action=constraints.first.update min=constraints.first.min max=constraints.first.max}}
  {{x-range action=constraints.second.update min=constraints.second.min max=constraints.second.max}}
  {{x-range action=constraints.third.update min=constraints.third.min max=constraints.third.max}}
{{/slider-constraints}}

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

2 participants