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

Can't use a minimum value of 0 with logarithmic slider #835

Closed
2 tasks done
bear454 opened this issue May 30, 2018 · 3 comments · Fixed by #836
Closed
2 tasks done

Can't use a minimum value of 0 with logarithmic slider #835

bear454 opened this issue May 30, 2018 · 3 comments · Fixed by #836

Comments

@bear454
Copy link
Contributor

bear454 commented May 30, 2018

Issues

NOTE: Before filing a new issue, please search through the open issues list and check to see if an existing issue already exists that describes your problem. If so, leave a comment within that issue with the checklist items described below.

Please make sure you include the following in your issue report where appropriate:

  • JSFiddle (or an equivalent such as CodePen, Plunker, etc) with the an example demonstrating the bug
  • Instructions to replicate the bug in the Fiddle

When using a logarithmic scale, 0 can not be selected on the slider. In short, log(0) = 1 :/

https://jsfiddle.net/j1LLdrhq/2/

To replicate, drag the slider off the initial '0' value, and try to drag it back to zero.

@seiyria
Copy link
Owner

seiyria commented May 30, 2018

Seems like log(0) is undefined behavior, so I'm not convinced this is a bug(?)

If you can abstract this away by using the formatter, that would be my recommendation.

@bear454
Copy link
Contributor Author

bear454 commented May 30, 2018

Sorry - I misstated; can we start over? :D

The issue arrises in https://github.com/seiyria/bootstrap-slider/blob/master/src/js/bootstrap-slider.js#L300

Given for example: min = 0; max = 64; percentage = 0:

min + (max - min) * percentage / 100
=> 0

Math.exp(min + (max - min) * percentage / 100)
=> 1

@bear454
Copy link
Contributor Author

bear454 commented Jun 5, 2018

@seiyria thanks for reconsidering; pull request #836 posted.

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

Successfully merging a pull request may close this issue.

2 participants