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

Slider: Modified to allow value reach max value with float step #1465

Closed
wants to merge 2 commits into from
Closed

Slider: Modified to allow value reach max value with float step #1465

wants to merge 2 commits into from

Conversation

atomiomi
Copy link
Contributor

@atomiomi atomiomi commented Mar 4, 2015

with step of 0.01 value did not reached max value

Fixes #11286

with step of 0.01 value did not reached max value

Fixes #11286
@@ -558,7 +558,7 @@ return $.widget( "ui.slider", $.ui.mouse, {
var max = this.options.max,
min = this._valueMin(),
step = this.options.step,
aboveMin = Math.floor( ( max - min ) / step ) * step;
aboveMin = Math.floor( ( +( max - min ).toFixed(5) ) / step ) * step;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not use arbitrary precision. See

_precision: function() {
.

in "_calculateNewMax" difference between max and min was fixed to 5 precision

Fixes #11286
@scottgonzalez
Copy link
Member

Merged with some style updates. Thanks.

scottgonzalez pushed a commit that referenced this pull request Mar 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants