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

Handling values and step #124

Open
skyksandr opened this issue Aug 12, 2020 · 2 comments
Open

Handling values and step #124

skyksandr opened this issue Aug 12, 2020 · 2 comments

Comments

@skyksandr
Copy link

Hi @sghall. First of all - Thank you for your work, this is a great component to work with!

Problem or feature description:

While migrating from https://github.com/IonDen/ion.rangeSlider I faced couple of issues:

  • I was unable to set min and max values that are not matched with step
  • When passing handle value as a prop, that not match step the value being corrected

Steps to reproduce (for problems):

For the first case:
Set min as 156 and max 320, step 50

I'd like to have slider starting with 156, then having ticks on 200, 250, 300 and ending with 320. With an ability to move handles to all of these possible values.

For the second case
Set min as 156 and max 320, step 50
Set current value as 222 - I'd expect this value not being corrected.

Versions (for problems):

React-Compound-Slider: 2.5.0
React: 16.10
Browser: all
Operating System: all

I've adjusted behaviour by inheriting from Slider and making changes to getDerivedStateFromProps and DiscreteScale.

Would you be interested in a PR that covers such cases?
If so - will approach of adding a props for providing custom scale and for value auto-correction work?

@dmitru
Copy link

dmitru commented Feb 4, 2021

@skyksandr Hi, running in the same problem and I'd REALLY appreciate if you could share you solution!

This auto-correction behavior is quite annoying, I wish there was a way to disable it.

@skyksandr
Copy link
Author

@dmitru I created a component inherited from original slider and adjusted code in scales. Have a look on

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