Skip to content

Commit 0d0969c

Browse files
poplixscottgonzalez
authored andcommitted
Slider: Changed _trimAlignValue function to return the correct inclusive value between min and max. Fixes #6643 - using range and step options makes jquery change min and max.
1 parent 22cf318 commit 0d0969c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ui/jquery.ui.slider.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,14 +585,14 @@ $.widget( "ui.slider", $.ui.mouse, {
585585

586586
// returns the step-aligned value that val is closest to, between (inclusive) min and max
587587
_trimAlignValue: function( val ) {
588-
if ( val < this._valueMin() ) {
588+
if ( val <= this._valueMin() ) {
589589
return this._valueMin();
590590
}
591-
if ( val > this._valueMax() ) {
591+
if ( val >= this._valueMax() ) {
592592
return this._valueMax();
593593
}
594594
var step = ( this.options.step > 0 ) ? this.options.step : 1,
595-
valModStep = val % step,
595+
valModStep = (val - this._valueMin()) % step;
596596
alignValue = val - valModStep;
597597

598598
if ( Math.abs(valModStep) * 2 >= step ) {

0 commit comments

Comments
 (0)