Skip to content

Commit 8932df7

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 1973024 commit 8932df7

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
@@ -547,13 +547,8 @@ return $.widget( "ui.slider", $.ui.mouse, {
547547
},
548548

549549
_calculateNewMax: function() {
550-
var max = this._valueMin(),
551-
step = this.options.step;
552-
553-
while ( max + step <= this.options.max ) {
554-
max = max + step;
555-
}
556-
this.max = max;
550+
var remainder = ( this.options.max - this._valueMin() ) % this.options.step;
551+
this.max = this.options.max - remainder;
557552
},
558553

559554
_valueMin: function() {

0 commit comments

Comments
 (0)