Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11286 closed bug (fixed)

Slider: Cannot reach max value with step of 0.01

Reported by: groonya Owned by:
Priority: blocker Milestone: 1.11.4
Component: ui.slider Version: 1.11.3
Keywords: Cc:
Blocked by: Blocking:

Description

I've created a slider with values from 50 to 60 with a 0.01 step. The lower bound works just fine, but the max value is never able to be reached via the slider.

Here's a jsfiddle example:

http://jsfiddle.net/v13t8cmj/7/

The slider in the example should go to 60, however it stops at 59.99.

Similar bug was in 1.11.2 for 0.1 step: http://bugs.jqueryui.com/ticket/10721

Change History (6)

comment:1 Changed 9 years ago by Scott González

Milestone: none1.12.0
Priority: minorblocker
Status: newopen
Summary: Cannot reach max value with step of 0.01Slider: Cannot reach max value with step of 0.01

comment:2 Changed 9 years ago by groonya

I mistake. For integer values is all ok. But for float... Look at this: http://jsfiddle.net/v13t8cmj/9/

comment:3 Changed 9 years ago by atomiomi

I think the problem in "_calculateNewMax" method, because it takes max (for example 2.4) and turns it to 2.39. The problem is that js calculate: 2.4 - 2 = 0.39999999.

Last edited 9 years ago by atomiomi (previous) (diff)

comment:4 Changed 9 years ago by Ablay Keldibek

Resolution: fixed
Status: openclosed

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

Fixes #11286 Closes gh-1465

Changeset: 60c00cd4ecdab41f44e125efe2679223e9cd5535

comment:5 Changed 9 years ago by Ablay Keldibek

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

Fixes #11286 Closes gh-1465 (cherry picked from commit 60c00cd4ecdab41f44e125efe2679223e9cd5535)

Changeset: 0f99e9c9693b05199d9f8c1137606c7033e19f38

comment:6 Changed 9 years ago by Scott González

Milestone: 1.12.01.11.4
Note: See TracTickets for help on using tickets.