Skip to content

Commit 1a28670

Browse files
committed
Slider: Create a copy of the options.values array for the return value of _value(). Fixes #4751 - Dragging slider modifies values, even if callback returns false.
Thanks bkrausz.
1 parent aacecd6 commit 1a28670

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ui/ui.slider.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,9 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, {
482482

483483
return val;
484484
} else {
485-
return this.options.values;
485+
// .slice() creates a copy of the array
486+
// this prevents outside manipulation of the internal state
487+
return this.options.values.slice();
486488
}
487489

488490
},

0 commit comments

Comments
 (0)