Skip to content

Commit ada0337

Browse files
committed
ui.slider: modified , avoid loop for CalculateNewMax. Fixed #9376 - ui.slider: On mouse move slider sets value more than max
1 parent b7273b6 commit ada0337

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

ui/slider.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -545,13 +545,8 @@ return $.widget( "ui.slider", $.ui.mouse, {
545545
},
546546

547547
_calculateNewMax: function() {
548-
var max = this._valueMin(),
549-
step = this.options.step;
550-
551-
while ( max + step <= this.options.max ) {
552-
max = max + step;
553-
}
554-
this.max = max;
548+
var remainder = ( this.options.max - this._valueMin() ) % this.options.step;
549+
this.max = this.options.max - remainder;
555550
},
556551

557552
_valueMin: function() {

0 commit comments

Comments
 (0)