Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#1865 closed bug (fixed)

slider curValue ignores minValue

Reported by: nostrademons Owned by: paul
Priority: major Milestone: 1.5
Component: ui.core Version: 1.2.1
Keywords: Cc:
Blocked by: Blocking:


With this test case:

<div id = "slider" class = "ui-slider-1">
<div id = "sliderThumb" class = "ui-slider-handle"></div>
<input id = "sliderVal" size = "4"/>
<script type = "text/javascript">
$(document).ready(function() {
        minValue: 20,
        maxValue: 40,
        slide: function(e, ui) {

The values assigned to the text field range from 0 to 20 instead of 20 to 40.

Change History (6)

comment:1 Changed 15 years ago by nostrademons

Changing line 237 of ui.slider.js from

this.curValue = (Math.round((m/p)*o.realValue));


this.curValue = o.minValue + (Math.round((m/p)*o.realValue));

seems to fix the problem.

comment:2 Changed 15 years ago by paul

Owner: set to paul
Status: newassigned

comment:3 Changed 15 years ago by nostrademons

After more investigation, this seems to be a documentation bug. The correct value is returned by ui.value and ui.values, but the documentation says to use ui.slider.curValue. The patch above breaks other things (notably, the values returned by ui.value and ui.values), so disregard it and fix the documentation so that people don't use the wrong interface.

comment:4 Changed 15 years ago by paul

Resolution: fixed
Status: assignedclosed

Sorry, this has been complete redone and is therefore fixed. Thanks.

comment:5 Changed 15 years ago by (none)

Milestone: 1.2.2

Milestone 1.2.2 deleted

comment:6 Changed 14 years ago by paul

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