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

NaN values when range start and end are equal #103

Closed
vbachev opened this issue Aug 29, 2013 · 5 comments
Closed

NaN values when range start and end are equal #103

vbachev opened this issue Aug 29, 2013 · 5 comments

Comments

@vbachev
Copy link

vbachev commented Aug 29, 2013

Hello! Congrats for the awesome product!
Ive got a tiny issue here. In my use case I need to dynamically reinitialize the slider with new configuration options. It is possible that the options may include equal range values.

If the range boundaries are equal the percentage._length() will return 0 that will cause NaN after division in percentage.to() or percentage.from().

If you consider this not to be a real issue (after all who needs a slider to slide between equal values?! :)) perhaps it could be included in the bad input detection section

@leongersen
Copy link
Owner

You are right, this should error out. Still, you probably should validate that input youself, since even if the slider throws an error, that doesn't help your user, which you probably figured out. Thanks for reporting!

@leongersen
Copy link
Owner

Fixed in version 4.0.2. Proof.

@evangelion1204
Copy link

Hi,

I have the same problem again, if min and max have the same value it will result in NaN as values.

@leongersen leongersen reopened this Oct 10, 2014
@leongersen
Copy link
Owner

Merging this with #236.

@github-actions
Copy link

github-actions bot commented Jun 7, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants