Modify ↓
Ticket #1865 (closed bug: fixed)
slider curValue ignores minValue
| Reported by: | nostrademons | Owned by: | paul |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2.2 |
| Component: | ui | Version: | 1.2.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
With this test case:
<div id = "slider" class = "ui-slider-1">
<div id = "sliderThumb" class = "ui-slider-handle"></div>
</div>
<input id = "sliderVal" size = "4"/>
<script type = "text/javascript">
$(document).ready(function() {
$('#slider').slider({
minValue: 20,
maxValue: 40,
slide: function(e, ui) {
$('#sliderVal').val(ui.slider.curValue);
}
});
});
The values assigned to the text field range from 0 to 20 instead of 20 to 40.
Change History
comment:3 Changed 6 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.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Changing line 237 of ui.slider.js from
to
seems to fix the problem.