Skip to content

Ticks on slider are not stretch properly #414

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
girniakolenka opened this issue Sep 22, 2016 · 8 comments
Closed

Ticks on slider are not stretch properly #414

girniakolenka opened this issue Sep 22, 2016 · 8 comments

Comments

@girniakolenka
Copy link

girniakolenka commented Sep 22, 2016

Steps to reproduce

  1. I have created simple slider with range by using stepsArray property
  2. $scope.minRangeSlider = { minValue: 10, maxValue: 100, options: { floor: 0, ceil: 100, showTicksValues: true, stepsArray: [10, 17, 71, 86, 100] } };

Demo: https://jsfiddle.net/8yt262cg/ (fork this example and update the link)
I have edited your examples (example with "Range slider")

Expected behaviour

Ticks on slider should stretch depends on values which they have
exp

Actual behaviour

Ticks on slider are not stretch properly
act

@ValentinH
Copy link
Member

Unfortunately, this is not possible with the current version. This limitation is due to the way the ticks are rendered: flexbox is used and so the ticks are automatically spread on the slider.

At the moment, I don't have any solution to provide...

@girniakolenka
Copy link
Author

Is there any possibility that it will be fixed in next versions?

@ValentinH
Copy link
Member

I can't take any engagement on it. If somebody provide a pull request that provide a good solution, I would be happy to accept it.

At the moment, I am less active on this repository support so I would probably not do it myself.

@girniakolenka
Copy link
Author

Ok, thank you for your response

@ValentinH
Copy link
Member

@girniakolenka I have work on a ticks refactoring that enables to position ticks at specific position: #426. Do you think it would match your needs?

@ValentinH
Copy link
Member

#426 has been merged so ticksArray is available from 5.6.0. Now you can have a slider that look likes what you wanted, but it will still have intermediate positions... With the current implementation of the slider, this is not possible.

@ValentinH
Copy link
Member

If you only want these values: [10, 17, 71, 86, 100] and if they need to be positioned like in the example you gave, you can implement your own custom scale by using the customValueToPosition and customPositionToValue options.

@girniakolenka
Copy link
Author

Thank you very much!

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

No branches or pull requests

2 participants